in reply to Turn matching against undef to be deadly
use strict; use warnings; use Carp; local $SIG{__WARN__} = sub { if ($_[0] =~ /Use of uninitialized value in regexp compilation/) { confess $_[0]; } else { warn @_; } }; print "x".undef, "\n"; printf "matched: %s\n" , ( 'x' =~ undef() ? 'yes' : 'no' ) ; __END__ Use of uninitialized value in concatenation (.) or string at 1.pl line + 14. x Use of uninitialized value in regexp compilation at 1.pl line 16. at 1.pl line 7. main::__ANON__('Use of uninitialized value in regexp compilati +on at 1.pl line...') called at 1.pl line 16
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Turn matching against undef to be deadly ( use warnings qw/ FATAL all /;
by Anonymous Monk on Sep 26, 2013 at 13:25 UTC | |
|
Re^2: Turn matching against undef to be deadly
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 |