Perl中的trim函数 zhumao sub trim{ my $string = shift; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string;}