There's no sub for trimming strings in perl. The best way is probably to just go ahead and bite the bullet:
my $temp = " Hello "; $temp =~ s/^\s+//; $temp =~ s/\s+$//;
You can write your own trim() function to automate this if you wish.
--
perl: code of the samurai
In reply to Re: TRIM in Perl?
by samurai
in thread TRIM in Perl?
by peacemaker1820
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |