The $^W flag can allow you see if -w has been specified:

$ perl -mstrict -we 'warn "Danger Will Robinson" if $^W;'
Danger Will Robinson at -e line 1.
$

but if you use warnings instead it doesn;t work:

$ perl -mstrict -e 'use warnings;warn "warn" if $^W;no warnings;warn "foo" if $^W;'
$


Anyone have any idea how to tell is its in use warnings or no warnings mode?

use strict;
use warnings;

warn "warnings are on" if ???; # this should print

no warnings;

warn "warnings are on" if ???; # this should not

?

TIA!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to