in reply to Weird underscore/whitespace failing regex
use Data::Dumper; $Data::Dumper::Useqq = 1; print Dumper($str); [download]
This will show you what's insider your $str.