in reply to Re^3: trim leading & trailing whitespacein thread trim leading & trailing whitespace
How about this:
$_ = " yes \n \n \n they \n \n will \n\n\n";
% perl 443391.pl
the lowliest monk
Perhaps replace the \b(.*?) with (\S.*?).
Still, you're not running this with warnings enabled, are you? Both $1 and $2 are optional, so both can be undef, but you use their value regardless. This runs without warnings:
Once (shame on you!)
Twice (shame on me!)
More often than I'd like to be
All the time
Just when answering stupid polls
Who you callin' a fool?
I refuse to vote in this ridiculous poll
Results (431 votes). Check out past polls.