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 reply to Re: use of "use X"
by JavaFan
in thread use of "use X"
by bbfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |