This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rename t/pragma/warn-* to t/pragma/warn/*, be 8.3-friendly
[perl5.git] / t / pragma / warn / 3both
CommitLineData
599cee73
PM
1Check interaction of $^W and lexical
2
3__END__
4
5# Check interaction of $^W and use warning
6sub fred {
7 use warning ;
8 my $b ;
9 chop $b ;
10}
11{ local $^W = 0 ;
12 fred() ;
13}
14
15EXPECT
16Use of uninitialized value at - line 6.
17########
18
19# Check interaction of $^W and use warning
20sub fred {
21 no warning ;
22 my $b ;
23 chop $b ;
24}
25{ local $^W = 1 ;
26 fred() ;
27}
28
29EXPECT
30Use of uninitialized value at - line 6.
31########
32
33# Check interaction of $^W and use warning
34use warning ;
35$^W = 1 ;
36my $b ;
37chop $b ;
38EXPECT
39Use of uninitialized value at - line 6.
40########
41
42# Check interaction of $^W and use warning
43$^W = 1 ;
44use warning ;
45my $b ;
46chop $b ;
47EXPECT
48Use of uninitialized value at - line 6.
49########
50
51# Check interaction of $^W and use warning
52$^W = 1 ;
53no warning ;
54my $b ;
55chop $b ;
56EXPECT
57Use of uninitialized value at - line 6.
58########
59
60# Check interaction of $^W and use warning
61no warning ;
62$^W = 1 ;
63my $b ;
64chop $b ;
65EXPECT
66Use of uninitialized value at - line 6.