autoquote barewords followed by newline and arrow properly
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / 4lint
CommitLineData
599cee73 1Check lint
2
3__END__
4-W
5# lint: check compile time $^W is zapped
6BEGIN { $^W = 0 ;}
7$a = $b = 1 ;
8$a = 1 if $a EQ $b ;
9close STDIN ; print STDIN "abc" ;
10EXPECT
11Use of EQ is deprecated at - line 5.
9a7dcd9c 12print() on closed filehandle main::STDIN at - line 6.
599cee73 13########
14-W
15# lint: check runtime $^W is zapped
16$^W = 0 ;
17close STDIN ; print STDIN "abc" ;
18EXPECT
9a7dcd9c 19print() on closed filehandle main::STDIN at - line 4.
599cee73 20########
21-W
22# lint: check runtime $^W is zapped
23{
24 $^W = 0 ;
25 close STDIN ; print STDIN "abc" ;
26}
27EXPECT
9a7dcd9c 28print() on closed filehandle main::STDIN at - line 5.
599cee73 29########
30-W
4438c4b7 31# lint: check "no warnings" is zapped
32no warnings ;
599cee73 33$a = $b = 1 ;
34$a = 1 if $a EQ $b ;
35close STDIN ; print STDIN "abc" ;
36EXPECT
37Use of EQ is deprecated at - line 5.
9a7dcd9c 38print() on closed filehandle main::STDIN at - line 6.
599cee73 39########
40-W
4438c4b7 41# lint: check "no warnings" is zapped
599cee73 42{
4438c4b7 43 no warnings ;
599cee73 44 close STDIN ; print STDIN "abc" ;
45}
46EXPECT
9a7dcd9c 47print() on closed filehandle main::STDIN at - line 5.
599cee73 48########
49-Ww
50# lint: check combination of -w and -W
51{
52 $^W = 0 ;
53 close STDIN ; print STDIN "abc" ;
54}
55EXPECT
9a7dcd9c 56print() on closed filehandle main::STDIN at - line 5.
599cee73 57########
58-W
59--FILE-- abc.pm
4438c4b7 60no warnings 'deprecated' ;
599cee73 61my ($a, $b) = (0,0);
621 if $a EQ $b ;
631;
64--FILE--
4438c4b7 65no warnings 'uninitialized' ;
599cee73 66use abc;
67my $a ; chop $a ;
68EXPECT
69Use of EQ is deprecated at abc.pm line 3.
b89fed5f 70Use of uninitialized value in scalar chop at - line 3.
599cee73 71########
72-W
73--FILE-- abc
4438c4b7 74no warnings 'deprecated' ;
599cee73 75my ($a, $b) = (0,0);
761 if $a EQ $b ;
771;
78--FILE--
4438c4b7 79no warnings 'uninitialized' ;
599cee73 80require "./abc";
81my $a ; chop $a ;
82EXPECT
83Use of EQ is deprecated at ./abc line 3.
b89fed5f 84Use of uninitialized value in scalar chop at - line 3.
599cee73 85########
86-W
87--FILE-- abc.pm
88BEGIN {$^W = 0}
89my ($a, $b) = (0,0);
901 if $a EQ $b ;
911;
92--FILE--
93$^W = 0 ;
94use abc;
95my $a ; chop $a ;
96EXPECT
97Use of EQ is deprecated at abc.pm line 3.
b89fed5f 98Use of uninitialized value in scalar chop at - line 3.
599cee73 99########
100-W
101--FILE-- abc
102BEGIN {$^W = 0}
103my ($a, $b) = (0,0);
1041 if $a EQ $b ;
1051;
106--FILE--
107$^W = 0 ;
108require "./abc";
109my $a ; chop $a ;
110EXPECT
111Use of EQ is deprecated at ./abc line 3.
b89fed5f 112Use of uninitialized value in scalar chop at - line 3.
16ff4256 113########
114-W
115# Check scope of pragma with eval
116{
117 no warnings ;
118 eval '
119 my $b ; chop $b ;
120 '; print STDERR $@ ;
121 my $b ; chop $b ;
122}
123EXPECT
124Use of uninitialized value in scalar chop at (eval 1) line 2.
125Use of uninitialized value in scalar chop at - line 8.
126########
127-W
128# Check scope of pragma with eval
129use warnings;
130{
131 no warnings ;
132 eval q[
133 use warnings 'uninitialized' ;
134 my $b ; chop $b ;
135 ]; print STDERR $@;
136 my $b ; chop $b ;
137}
138EXPECT
139Use of uninitialized value in scalar chop at (eval 1) line 3.
140Use of uninitialized value in scalar chop at - line 10.
141########
142-W
143# Check scope of pragma with eval
144no warnings;
145{
146 use warnings 'uninitialized' ;
147 eval '
148 my $b ; chop $b ;
149 '; print STDERR $@ ;
150 my $b ; chop $b ;
151}
152EXPECT
153Use of uninitialized value in scalar chop at (eval 1) line 2.
154Use of uninitialized value in scalar chop at - line 9.
155########
156-W
157# Check scope of pragma with eval
158no warnings;
159{
160 use warnings 'uninitialized' ;
161 eval '
162 no warnings ;
163 my $b ; chop $b ;
164 '; print STDERR $@ ;
165 my $b ; chop $b ;
166}
167EXPECT
168Use of uninitialized value in scalar chop at (eval 1) line 3.
169Use of uninitialized value in scalar chop at - line 10.
170########
171-W
172# Check scope of pragma with eval
173use warnings;
174{
175 my $a = "1"; my $b = "2";
176 no warnings ;
177 eval q[
178 use warnings 'deprecated' ;
179 1 if $a EQ $b ;
180 ]; print STDERR $@;
181 1 if $a EQ $b ;
182}
183EXPECT
184Use of EQ is deprecated at - line 11.
185Use of EQ is deprecated at (eval 1) line 3.
186########
187-W
188# Check scope of pragma with eval
189no warnings;
190{
191 my $a = "1"; my $b = "2";
192 use warnings 'deprecated' ;
193 eval '
194 1 if $a EQ $b ;
195 '; print STDERR $@;
196 1 if $a EQ $b ;
197}
198EXPECT
199Use of EQ is deprecated at - line 10.
200Use of EQ is deprecated at (eval 1) line 2.
201########
202-W
203# Check scope of pragma with eval
204no warnings;
205{
206 my $a = "1"; my $b = "2";
207 use warnings 'deprecated' ;
208 eval '
209 no warnings ;
210 1 if $a EQ $b ;
211 '; print STDERR $@;
212 1 if $a EQ $b ;
213}
214EXPECT
215Use of EQ is deprecated at - line 11.
216Use of EQ is deprecated at (eval 1) line 3.