From edc2a884d1bce59b0e2134efcf30084e2d5cf38b Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 14 Jun 2022 15:33:37 +0200 Subject: tidy use of given/when, and silence warnings --- bin/feature-check.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/feature-check.pl b/bin/feature-check.pl index e6f3514..4c1fe24 100755 --- a/bin/feature-check.pl +++ b/bin/feature-check.pl @@ -3,6 +3,7 @@ use v5.14; use utf8; use warnings; +no warnings 'experimental::smartmatch'; use open qw( :std :encoding(UTF-8) ); use Getopt::Long 2.24 qw(:config gnu_getopt); @@ -203,11 +204,11 @@ my $table = Term::Table->new( ); for ( $OPT{format} ) { - map { say $_ } $table->render when 'table'; - print $graph->as_ascii() when 'ascii'; - print $graph->as_boxart() when 'ansi'; - print $graph->as_svg() when 'svg'; - print $graph->as_graphviz() when 'graphviz'; + when ('table') { map { say $_ } $table->render } + when ('ascii') { print $graph->as_ascii() } + when ('ansi') { print $graph->as_boxart() } + when ('svg') { print $graph->as_svg() } + when ('graphviz') { print $graph->as_graphviz() } default { $log->fatal("unsupported format:$_") && exit 1 } } -- cgit v1.2.3