Is there a way to do this in one line?
$x =~ s/^\\s+//; $x =~ s/\\s+$//;
In other words, remove all leading and trailing whitespace from a stri
Funny you should bring this up!
I recently read an article analyzing the performance of twelve (!) different trim implementations.
Although the article specifically uses the JavaScript regex implementation, it uses Perl syntax, so I think it's apropos to this discussion.