git.shiar.nl
/
barcat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
enable lexical subs before perl v5.26
[barcat.git]
/
graph
diff --git
a/graph
b/graph
index eaafb764d387a5f65514ed3fcb017e8763e62840..307c9e41d47bfc031ad0e897ee120d4c9c3a19f4 100755
(executable)
--- a/
graph
+++ b/
graph
@@
-1,9
+1,10
@@
#!/usr/bin/env perl
#!/usr/bin/env perl
-use 5.01
4
;
+use 5.01
8
;
use warnings;
use utf8;
use List::Util qw( min max sum );
use open qw( :std :utf8 );
use warnings;
use utf8;
use List::Util qw( min max sum );
use open qw( :std :utf8 );
+use experimental qw( lexical_subs );
our $VERSION = '1.02';
our $VERSION = '1.02';
@@
-39,7
+40,7
@@
$SIG{INT} = 'IGNORE'; # continue after assumed eof
my (@lines, @values);
while (readline) {
my (@lines, @values);
while (readline) {
-
chomp
;
+
s/\r?\n\z//
;
s/^\h*// unless $opt{unmodified};
push @values, s/^ ( \h* -? [0-9]* \.? [0-9]+ |)//x && $1;
if (defined $opt{trim}) {
s/^\h*// unless $opt{unmodified};
push @values, s/^ ( \h* -? [0-9]* \.? [0-9]+ |)//x && $1;
if (defined $opt{trim}) {
@@
-53,13
+54,13
@@
while (readline) {
}
push @lines, $_;
}
}
push @lines, $_;
}
-@lines or exit;
$SIG{INT} = 'DEFAULT';
sub show_lines {
state $nr = 0;
$SIG{INT} = 'DEFAULT';
sub show_lines {
state $nr = 0;
+@lines and @lines > $nr or return;
my @order = sort { $b <=> $a } grep { length } @values;
my $maxval = $order[0];
my @order = sort { $b <=> $a } grep { length } @values;
my $maxval = $order[0];