in reply to Re: Turning on regexp debugging at runtime
in thread Turning on regexp debugging at runtime
As for easily turning debugging on and off, here's one way via environment vars:
my $re1 = qr/foo|bar/; { use if $ENV{DEBUG_REGEX}, qw/re Debug EXECUTE/; my $re2 = qr/quz|baz/; print "xfoox"=~$re1, "ybazy"=~$re2; }
gives you run-time debug info on $re2 only when the environment var DEBUG_REGEX is set.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Turning on regexp debugging at runtime
by SBECK (Chaplain) on Sep 23, 2014 at 16:15 UTC | |
by Anonymous Monk on Sep 23, 2014 at 16:29 UTC | |
by SBECK (Chaplain) on Sep 23, 2014 at 17:11 UTC | |
by FloydATC (Deacon) on Sep 24, 2014 at 11:32 UTC | |
by RonW (Parson) on Sep 24, 2014 at 16:35 UTC | |
by choroba (Cardinal) on Sep 24, 2014 at 17:03 UTC | |
by Monk::Thomas (Friar) on Sep 24, 2014 at 14:00 UTC | |
by SBECK (Chaplain) on Sep 24, 2014 at 17:34 UTC | |
by roboticus (Chancellor) on Sep 24, 2014 at 20:28 UTC | |
by Monk::Thomas (Friar) on Sep 25, 2014 at 07:43 UTC |
In Section
Seekers of Perl Wisdom