good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: chomp each element of arrayby JockoHelios (Scribe) |
on Jun 10, 2013 at 11:04 UTC ( [id://1038044]=note: print w/replies, xml ) | Need Help?? |
Soren is right. The reason this works is that the array is evaluated in a list context - each row is sent to chomp. Which is the same reason, I believe, that foreach( @array ) processes each row of an array. Context is a central concept in Perl. It's one of the reasons that you don't have to code the sort of detail needed in many other programming languages.
Dyslexics Untie !!!
In Section
Seekers of Perl Wisdom
|
|