in reply to Silly RegEx problem

Do not  say my $foo if bar; $foo will not be properly initialized to undef if bar is false.   As the FM says, "Here be dragons."   (And Abigail, I'd expect you to have seen just how often this bites people here at perlmonks.)