⭐ in reply to How do I remove whitespace at the beginning or end of my string?
You could also do this in just one step. Use foreach's
aliasing behavior to write this:
for ($string) { s/^\s+//; s/\s+$//; }
In Section
Seekers of Perl Wisdom