Perl: the Markov chain saw | |
PerlMonks |
Re^2: Mapping list to hash is dropping list items (trim whitespace)by eyepopslikeamosquito (Archbishop) |
on Mar 13, 2022 at 12:06 UTC ( [id://11142069]=note: print w/replies, xml ) | Need Help?? |
Trimming leading and trailing whitespace from a string is a FAQ. Like you, I think it's simplest and clearest to do it in two simple statements. To nickpick your solution, it's better to replace * with + like so:
See also:
In Section
Seekers of Perl Wisdom
|
|