in reply to Passing regex result into function
my $str = 'abc'; my ($arg) = $str =~ /b/i; PassRegex($arg, 'parm2', 'parm3');
Regex matches behave differently depending if they are in a list or scalar context.
Update: And to more specifically answer your question, no match returns undef
.Update 2: You could also do something like this:
PassRegex($str =~ /b/i || 0, 'parm2', 'parm3');
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing regex result into function
by AnomalousMonk (Archbishop) on Apr 16, 2016 at 00:24 UTC | |
|
Re^2: Passing regex result into function
by sdsommer (Initiate) on Apr 15, 2016 at 20:49 UTC |