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.
In reply to Re: Why doesn't this work?
by hdb
in thread Why doesn't this work?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |