From: Mischa POSLAWSKY Date: Sat, 22 Feb 2020 00:47:57 +0000 (+0100) Subject: end subroutines with return X-Git-Tag: v1.08~33 X-Git-Url: http://git.shiar.nl/barcat.git/commitdiff_plain/df0c8de6d8a58b68a94308ef203ee685d6e2fbd9 end subroutines with return Stern perlcritic complaint, referencing page 197 of PBP. --- diff --git a/barcat b/barcat index 7a0bf87..b0237c4 100755 --- a/barcat +++ b/barcat @@ -185,7 +185,7 @@ sub color { sub sival { my $unit = int(log(abs $_[0] || 1) / log(10) - 3*($_[0] < 1) + 1e-15); my $float = $_[0] !~ /\A0*[-0-9]{1,3}\z/; - sprintf('%3.*f%1s', + return sprintf('%3.*f%1s', $float && ($unit % 3) == ($unit < 0), # tenths $_[0] / 1000 ** int($unit/3), # number $#{$opt{units}} * 1.5 < abs $unit ? "e$unit" : $opt{units}->[$unit/3] @@ -290,6 +290,7 @@ continue { } say $opt{palette} ? color(0) : '' if $opt{spark}; + return $nr; } sub show_stat { @@ -310,6 +311,7 @@ sub show_stat { ); } say ''; + return 1; } sub show_exit {