Hi All,

$ perl6 -e 'my $x="ab12cd"; $x ~~ m/ab(1q2)cd/; say "$x\n\$0=<$0>\n";'
Use of Nil in string context in block <unit> at -e line 1
ab12cd
$0=<>

With out the "q" in this, it works.  I deliberately put
the "q" to see what would happen when a patter was not
found.

Is there a way around the "use of nil" finger wag
if a patter is not found?

Or should I always test for its presence first if
there is a possibility the pattern might not exist?


Many thanks,
-T



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to