in reply to use of "use X"
Of course, that will prohibit warnings to be turned on from anywhere in your program.BEGIN { my $debug = 0; unless ($debug) { $INC {"warnings.pm"} = 1; no strict 'refs'; *{"warnings::import"} = sub {1;}; } } use warnings;
If you can live with just one category enabled if debugging is off, you could do:
BEGIN { $::DEBUG = 1; } use warnings $::DEBUG ? "all" : "io"; # Or some other category.
|
---|
In Section
Seekers of Perl Wisdom