And of course, it becomes essential when reading in a file, which could contain blank lines
Actually, no, Perl DWIMs this.
$ perl -MO=Deparse,-x7 -e'while($line=<$fh>){}'
while (defined($line = <$fh>)) {
();
}
-e syntax OK
But defined doesn’t help you in this case anyway, since undef is a legal value for an array element.
Makeshifts last the longest.
In reply to Re^5: Array Processing
by Aristotle
in thread Array Processing
by Rajeshk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |