in reply to Why doesn't this work?
This works for me:
time perl -e '$_=[];@$_=<>; my $count=@$_;print $count, " lines\n";' < + somefile.txt time perl -e '{$/=undef, $_=<>} my $count=split /\n/,$_; print $count, + " lines\n";' < somefile.txt
Your second version does not when splitting on \000.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why doesn't this work?
by perl-diddler (Chaplain) on Apr 12, 2013 at 22:01 UTC | |
by hdb (Monsignor) on Apr 13, 2013 at 06:54 UTC |