|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re^2: Little annoying mistakes ... of othersby Porculus (Hermit) |
| on Dec 07, 2008 at 14:25 UTC ( #728713=note: print w/ replies, xml ) | Need Help?? |
|
Can be written chomp(my $line = <STDIN>); ;D But that doesn't generalise for all rvalue uses. For example, I frequently want to write something like frobnicate(chomp) while <$file>; # doesn't workand am of course instead forced to write the loop out longhand, since chomp, frobnicate($_) while <$file>; # yuckis starting to get hard to read. Personally I consider this a failure in Perl's Huffman coding. I can't think of a single case where I've cared in the slightest how many characters chomp removed, but I do want to be able to chomp something and then immediately pass the chomped value to some other routine.
In Section
Meditations
|
|
||||||||||||||||||||||