use strict; my $name = ' John F. Doe '; print "($name)\n"; # Get rid of leading and trailing blanks $name =~ s/^\s*(.*\S|$)\s*$/$1/m; print "($name)\n";
In reply to Strip leading and trailing blanks by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |