I am trying to use the warnings pragma for my modules. In a simple module:
package foo;
use warnings::register;
sub bar {
if (warnings::enabled) {
warnings::warn "this is a warning";
}
}
The above works properly if I say 'use warnings' or 'no warnings' in my calling code.
But in larger (object oriented) modules it does not work. Or rather, warnings::enabled always returns false. If in the module I enable warnings, it works but I cannot turn off the warnings in my calling code.
Is there a bug in warnings, or is there some overlooked and possibly poorly-documented feature of warnings that I'm missing out on?
Also: Is there a way to get Carp working properly with warnings? (From what I've read, not yet. See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-11/msg01297.html)
In reply to How do I get warnings to work properly? by rrwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |