in reply to trimming space from both sides of a string

I find trimming space quite boring. There's nothing interesting about it. What I do is:
$str =~ s/^\s+//; $str =~ s/\s+$//;
rtrim/ltrim following trivially from it.