Surely all this depends on how much white space you're typically expecting.
Could the following not also be more efficent depending on the data:
if ($blah=~m/^\s/) {
$blah=~s/^\s+//;
}
or indeed (thanks to MZSanford for this one):
if (index($blah," ")) == 0 {
$blah=~s/^\s+//;
}
and for trailing - use rindex :).
UPDATE: Oops - The index solution only works for *
actual* spaces (thanks Hofmator).
That possibly gets you a little closer to the best of both worlds?
game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);