http://qs321.pair.com?node_id=948607


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).