in reply to use of "use X"
Wow! What a great response. Thank you all for the insights!!
Am much closer to the goal, now just stuck on the "inverse, sort of" (from the Camel Book) of "use", "no". Sorry, not meaning to be cryptic. Instead, here's some code that demonstrates what I was hoping to achieve:
use strict; my $debug; BEGIN { $debug = 3; } use if ($debug > 0), 'warnings'; use if ($debug > 1), 'diagnostics'; if ($debug > 2) { no warnings 'redefine'; } run_sub(); sub run_sub { print "Running\n";} sub run_sub { print "Ran\n";} if ($debug > 3) {print "DEBUG: blah, blah, ...\n";}
Have tried a few modifications, but none eliminated the 'redefine' warnings when ($debug > 2).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: use of "use X"
by chromatic (Archbishop) on Jan 18, 2012 at 21:28 UTC | |
by Anonymous Monk on Jan 18, 2012 at 22:28 UTC |
In Section
Seekers of Perl Wisdom