The m// operator returns false (the empty string), not undef, on match failure when evaluated in scalar context:
c:\@Work\Perl\monks>perl -wMstrict -le
"my $str = 'abc';
PassRegex(scalar($str =~ /x/i), 'parm2', 'parm3');
;;
use Data::Dumper;
;;
sub PassRegex {
print Dumper(\@_);
print qq{BoolExpr = '$_[0]' parm2 = '$_[1]' parm3 = '$_[2]'};
return;
}
"
$VAR1 = [
'',
'parm2',
'parm3'
];
BoolExpr = '' parm2 = 'parm2' parm3 = 'parm3'
Please see
Regexp Quote-Like Operators.
Give a man a fish: <%-{-{-{-<