http://www.perlmonks.org?node_id=11120708


in reply to Re: How to trim a line from leading and trailing blanks without using regex or non-standard modules
in thread How to trim a line from leading and trailing blanks without using regex or non-standard modules

That used to be the "standard way" to do this and was recommended in the Perl Docs and I thought it was just fine.
s/^\s+|\s+$//g has been benchmarked. And I now think this is faster and "better" than 2 statements. There is one post at Re^3: script optmization that shows some benchmarks.

This is certainly not an "abuse" of regex. This is what regex is is for! The Perl regex engine continually becomes better and usually faster between releases.