source: trunk/essentials/dev-lang/perl/t/lib/warnings/3both@ 3951

Last change on this file since 3951 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 4.0 KB
Line 
1Check interaction of $^W and lexical
2
3__END__
4
5# Check interaction of $^W and use warnings
6sub fred {
7 use warnings ;
8 my $b ;
9 chop $b ;
10}
11{ local $^W = 0 ;
12 fred() ;
13}
14
15EXPECT
16Use of uninitialized value in scalar chop at - line 6.
17########
18
19# Check interaction of $^W and use warnings
20sub fred {
21 use warnings ;
22 my $b ;
23 chop $b ;
24}
25{ $^W = 0 ;
26 fred() ;
27}
28
29EXPECT
30Use of uninitialized value in scalar chop at - line 6.
31########
32
33# Check interaction of $^W and use warnings
34sub fred {
35 no warnings ;
36 my $b ;
37 chop $b ;
38}
39{ local $^W = 1 ;
40 fred() ;
41}
42
43EXPECT
44
45########
46
47# Check interaction of $^W and use warnings
48sub fred {
49 no warnings ;
50 my $b ;
51 chop $b ;
52}
53{ $^W = 1 ;
54 fred() ;
55}
56
57EXPECT
58
59########