in reply to Regular Expression and trimming

Right from the Cookbook:
$string =~ s/^\s+//; $string =~ s/\s+$//;