|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re^2: How does this code work? (from "Perl is Unix")by Aristotle (Chancellor) |
| on Nov 07, 2009 at 03:18 UTC ( #805610=note: print w/ replies, xml ) | Need Help?? |
|
I didn’t aim for clarity in that bit. I wanted to waste the least space possible on code to perform this function, because I was contrasting with Ruby and Python examples, where there is no need to write any code for this because both languages include strip methods in their built in String classes. Maybe I should lobby for the inclusion of a strip function in Scalar::Util. (It could even be written in XS, and therefore go faster than regexes. Hmm. There’s a thought.) Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||