1N/ACheck default warnings
1N/A
1N/A__END__
1N/A# default warnings should be displayed if you don't add anything
1N/A# optional shouldn't
1N/Amy $a = oct "7777777777777777777777777777777777779" ;
1N/AEXPECT
1N/AInteger overflow in octal number at - line 3.
1N/A########
1N/A# no warnings should be displayed
1N/Ano warnings ;
1N/Amy $a = oct "7777777777777777777777777777777777778" ;
1N/AEXPECT
1N/A########
1N/A# all warnings should be displayed
1N/Ause warnings ;
1N/Amy $a = oct "7777777777777777777777777777777777778" ;
1N/AEXPECT
1N/AInteger overflow in octal number at - line 3.
1N/AIllegal octal digit '8' ignored at - line 3.
1N/AOctal number > 037777777777 non-portable at - line 3.
1N/A########
1N/A# check scope
1N/Ause warnings ;
1N/Amy $a = oct "7777777777777777777777777777777777778" ;
1N/A{
1N/A no warnings ;
1N/A my $a = oct "7777777777777777777777777777777777778" ;
1N/A}
1N/Amy $c = oct "7777777777777777777777777777777777778" ;
1N/AEXPECT
1N/AInteger overflow in octal number at - line 3.
1N/AIllegal octal digit '8' ignored at - line 3.
1N/AOctal number > 037777777777 non-portable at - line 3.
1N/AInteger overflow in octal number at - line 8.
1N/AIllegal octal digit '8' ignored at - line 8.
1N/AOctal number > 037777777777 non-portable at - line 8.
1N/A########
1N/A# all warnings should be displayed
1N/Ause warnings ;
1N/Amy $a = oct "0xfffffffffffffffffg" ;
1N/AEXPECT
1N/AInteger overflow in hexadecimal number at - line 3.
1N/AIllegal hexadecimal digit 'g' ignored at - line 3.
1N/AHexadecimal number > 0xffffffff non-portable at - line 3.
1N/A########
1N/A# all warnings should be displayed
1N/Ause warnings ;
1N/Amy $a = oct "0b111111111111111111111111111111111111111111111111111111111111111112";
1N/AEXPECT
1N/AInteger overflow in binary number at - line 3.
1N/AIllegal binary digit '2' ignored at - line 3.
1N/ABinary number > 0b11111111111111111111111111111111 non-portable at - line 3.
1N/A########
1N/A
1N/A# Check scope of pragma with eval
1N/Ause warnings;
1N/A{
1N/A no warnings ;
1N/A eval '
1N/A my $a = oct "0xfffffffffffffffffg" ;
1N/A '; print STDERR $@ ;
1N/A my $a = oct "0xfffffffffffffffffg" ;
1N/A}
1N/AEXPECT
1N/A
1N/A########
1N/A
1N/A# Check scope of pragma with eval
1N/Ause warnings;
1N/A{
1N/A no warnings ;
1N/A eval q[
1N/A use warnings ;
1N/A my $a = oct "0xfffffffffffffffffg" ;
1N/A ]; print STDERR $@;
1N/A my $a = oct "0xfffffffffffffffffg" ;
1N/A}
1N/AEXPECT
1N/AInteger overflow in hexadecimal number at (eval 1) line 3.
1N/AIllegal hexadecimal digit 'g' ignored at (eval 1) line 3.
1N/AHexadecimal number > 0xffffffff non-portable at (eval 1) line 3.
1N/A########
1N/A
1N/A# Check scope of pragma with eval
1N/Ano warnings;
1N/A{
1N/A use warnings ;
1N/A eval '
1N/A my $a = oct "0xfffffffffffffffffg" ;
1N/A '; print STDERR $@ ;
1N/A}
1N/AEXPECT
1N/AInteger overflow in hexadecimal number at (eval 1) line 2.
1N/AIllegal hexadecimal digit 'g' ignored at (eval 1) line 2.
1N/AHexadecimal number > 0xffffffff non-portable at (eval 1) line 2.
1N/A########
1N/A
1N/A# Check scope of pragma with eval
1N/Ano warnings;
1N/A{
1N/A use warnings;
1N/A eval '
1N/A no warnings ;
1N/A my $a = oct "0xfffffffffffffffffg" ;
1N/A '; print STDERR $@ ;
1N/A}
1N/AEXPECT
1N/A
1N/A########
1N/A
1N/A# Check scope of pragma with eval
1N/Ano warnings;
1N/A{
1N/A use warnings 'deprecated' ;
1N/A eval '
1N/A my $a = oct "0xfffffffffffffffffg" ;
1N/A '; print STDERR $@;
1N/A}
1N/AEXPECT
1N/A