In Perl, you want to remove white-space at beginning and end of strings.
sub trim {
my $str = shift;
$str =~ s/^\s+//;
$str =~ s/\s+$//;
return $str;
}
In Perl, you want to remove white-space at beginning and end of strings.
sub trim {
my $str = shift;
$str =~ s/^\s+//;
$str =~ s/\s+$//;
return $str;
}