Perl中的trim函数

sub trim

{

my $string = shift;

$string =~ s/^\s+//;

$string =~ s/\s+$//;

return $string;

}