Why not use something like:
$string =~ s/^\s+|\s+$//g;
That should cut spaces from start and end and leave the rest.In reply to Re^2: trimming space from both sides of a string
by yorfeix
in thread trimming space from both sides of a string
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |