On May 24, 2006, at 18:48, Gavin Bowlby wrote:

I can suppress all warning checks by doing a:

no warnings;
if ($a == 7) {
use warnings;

but I would like all other "normal" Perl warnings to be used for the
statement:

if ($a  == 7)

other than the check for the LHS of the equality check being a numeric
value.

Is this possible?

Warnings have a hierarchy documented in perllexwarn. The category each warning belongs to is documented in perldiag. In that case the most you can do is to disable the "numeric" category, which is the one that warning belongs according to perldiag:

  {
    no warnings qw(numeric);
    # issues "use of uninitialized ..." but not the "numeric" one
    print undef if "foo" == 0;
  }

-- fxn


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