Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: while(<>) { ... } considered harmfulby Juerd (Abbot) |
on Sep 08, 2002 at 00:55 UTC ( [id://195947]=note: print w/replies, xml ) | Need Help?? |
map { require Net::DNS } 1; Is that a map in void context? Nasty and evil. (I don't recall require ever returning anything useful.) Personally I prefer always using while(my $line = <>) construct. I don't always. Setting $_ lets one use regexes and simple commands easier. I do use a lexical for more complicated blocks, but I often find myself just slurping the file into an array first.
In Section
Meditations
|
|