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+$//; }
  • Comment on Re: How do I remove whitespace at the beginning or end of my string?
  • Download Code