(IMHO) the most common solution is:
s/^\s+//, s/\s+$// for $line;
In reply to Re: How to trim a line from leading and trailing blanks without using regex or non-standard modules
by jwkrahn
in thread How to trim a line from leading and trailing blanks without using regex or non-standard modules
by likbez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |