diff options
| -rwxr-xr-x | challenge-117/perlboy1967/perl/ch-1.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/challenge-117/perlboy1967/perl/ch-1.pl b/challenge-117/perlboy1967/perl/ch-1.pl index 1a22567af0..109b8e42e7 100755 --- a/challenge-117/perlboy1967/perl/ch-1.pl +++ b/challenge-117/perlboy1967/perl/ch-1.pl @@ -12,7 +12,6 @@ use strict; use warnings; use File::Basename qw(dirname); -use File::Slurp qw(read_file); use List::MoreUtils qw(slide); my $input = $ARGV[0] // sprintf('%s/input.txt',dirname($0)); @@ -23,6 +22,8 @@ printf "Missing row number(s) of file '%s' is/are '%s'\n", sub missingRows { my ($f) = @_; + + open(my $fh,'<',$f) || die; - return grep /\d/,slide{($a+1..$b-1)if($b-$a>1)}sort{$a<=>$b}map{/^(\d+)/;$_=$1}read_file($f); + return grep /\d/,slide{($a+1..$b-1)if($b-$a>1)}sort{$a<=>$b}map{/^(\d+)/;$_=$1}<$fh>; } |
