summaryrefslogtreecommitdiff
path: root/t/pragma/warn/6default
blob: c095b20827cce2c97ea4fee701bfd1656f89cc32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Check default warnings

__END__
# default warning should be displayed if you don't add anything
# optional shouldn't
my $a = oct "7777777777777777777777777777777777779" ;
EXPECT
Integer overflow in octal number at - line 3.
########
# no warning should be displayed 
no warning ;
my $a = oct "7777777777777777777777777777777777779" ;
EXPECT
########
# all warning should be displayed 
use warning ;
my $a = oct "7777777777777777777777777777777777779" ;
EXPECT
Integer overflow in octal number at - line 3.
Illegal octal digit '9' ignored at - line 3.
########
# check scope
use warning ;
my $a = oct "7777777777777777777777777777777777779" ;
{
    no warning ;
    my $a = oct "7777777777777777777777777777777777779" ;
}    
my $c = oct "7777777777777777777777777777777777779" ;
EXPECT
Integer overflow in octal number at - line 3.
Illegal octal digit '9' ignored at - line 3.
Integer overflow in octal number at - line 8.
Illegal octal digit '9' ignored at - line 8.