Message-ID: <AIEAJICLCBDNAAOLLOKL
CEFDDCAA.Paul_Marquess@Yahoo.co.uk>
p4raw-id: //depot/perl@12434
$mask |= $Bits{'all'} ;
$mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
}
- ${^WARNING_BITS} = $mask & ~ (bits(@_ ? @_ : 'all') | $All) ;
+ ${^WARNING_BITS} = $mask & ~ (bits('FATAL' => (@_ ? @_ : 'all')) | $All) ;
}
sub __chk
category into a fatal error, so the program terminates immediately it
encounters the warning.
+To explicitly disable a "FATAL" warning you just disable the warning it is
+associated with. So, for example, to disable the "void" warning in the
+example above, either of these will do the trick:
+
+ no warnings qw(void);
+ no warnings FATAL => qw(void);
=head2 Reporting Warnings from a Module
EXPECT
Useless use of time in void context at - line 4.
Useless use of length in void context at - line 8.
+########
+
+use warnings FATAL => 'all';
+{
+ no warnings;
+ my $b ; chop $b;
+ {
+ use warnings ;
+ my $b ; chop $b;
+ }
+}
+my $b ; chop $b;
+print STDERR "The End.\n" ;
+EXPECT
+Use of uninitialized value in scalar chop at - line 8.
+Use of uninitialized value in scalar chop at - line 11.
+########
+
+use warnings FATAL => 'all';
+{
+ no warnings FATAL => 'all';
+ my $b ; chop $b;
+ {
+ use warnings ;
+ my $b ; chop $b;
+ }
+}
+my $b ; chop $b;
+print STDERR "The End.\n" ;
+EXPECT
+Use of uninitialized value in scalar chop at - line 8.
+Use of uninitialized value in scalar chop at - line 11.
+########
+
+use warnings FATAL => 'all';
+{
+ no warnings 'syntax';
+ {
+ use warnings ;
+ my $b ; chop $b;
+ }
+}
+my $b ; chop $b;
+print STDERR "The End.\n" ;
+EXPECT
+Use of uninitialized value in scalar chop at - line 7.
$mask |= $Bits{'all'} ;
$mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
}
- ${^WARNING_BITS} = $mask & ~ (bits(@_ ? @_ : 'all') | $All) ;
+ ${^WARNING_BITS} = $mask & ~ (bits('FATAL' => (@_ ? @_ : 'all')) | $All) ;
}
sub __chk