Just another Perl shrine | |
PerlMonks |
Re^3: Forcing array context on a file handleby QM (Parson) |
on Nov 02, 2012 at 12:31 UTC ( [id://1001957]=note: print w/replies, xml ) | Need Help?? |
That works for files in the default case, because every line will have a newline or somesuch, and will not be an empty string. For counting, map would be more appropriate than grep. But tobyink showed the idiom above:
-QM
In Section
Seekers of Perl Wisdom
|
|