Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Due to my own syntax bug, what essentially happened was ...
cat p.pl; echo ; perl -Dr p.pl printf "matched: %s\n" , ( 'x' =~ undef() ? 'yes' : 'no' ) ; Omitting $` $& $' support. EXECUTING... Compiling REx "" Final program: 1: NOTHING (2) 2: END (0) minlen 0 Matching REx "" against "x" 0 <> <x> | 1:NOTHING(2) 0 <> <x> | 2:END(0) Match successful! matched: yes Freeing REx: ""
Is there a way to turn a *match attempt against an undef variable* to be deadly at run time? (I am well aware of the warning generated when matching against an undef value. By that warning itself I had located the error of my ways.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Turn matching against undef to be deadly
by vsespb (Chaplain) on Sep 26, 2013 at 13:16 UTC | |
by Anonymous Monk on Sep 26, 2013 at 13:25 UTC | |
by Anonymous Monk on Sep 26, 2013 at 13:37 UTC | |
by vsespb (Chaplain) on Sep 26, 2013 at 13:50 UTC | |
by AnomalousMonk (Archbishop) on Sep 26, 2013 at 16:00 UTC |