Commit | Line | Data |
4438c4b7 |
1 | Check FATAL functionality |
2 | |
3 | __END__ |
4 | |
5 | # Check compile time warning |
6 | use warnings FATAL => 'deprecated' ; |
7 | { |
8 | no warnings ; |
9 | 1 if $a EQ $b ; |
10 | } |
11 | 1 if $a EQ $b ; |
12 | print STDERR "The End.\n" ; |
13 | EXPECT |
14 | Use of EQ is deprecated at - line 8. |
15 | ######## |
16 | |
ee8c7f54 |
17 | # Check compile time warning |
18 | use warnings FATAL => 'all' ; |
19 | { |
20 | no warnings ; |
21 | 1 if $a EQ $b ; |
22 | } |
23 | 1 if $a EQ $b ; |
24 | print STDERR "The End.\n" ; |
25 | EXPECT |
26 | Use of EQ is deprecated at - line 8. |
27 | ######## |
28 | |
4438c4b7 |
29 | # Check runtime scope of pragma |
30 | use warnings FATAL => 'uninitialized' ; |
31 | { |
32 | no warnings ; |
33 | my $b ; chop $b ; |
34 | } |
35 | my $b ; chop $b ; |
36 | print STDERR "The End.\n" ; |
37 | EXPECT |
146174a9 |
38 | Use of uninitialized value in scalar chop at - line 8. |
4438c4b7 |
39 | ######## |
40 | |
41 | # Check runtime scope of pragma |
ee8c7f54 |
42 | use warnings FATAL => 'all' ; |
43 | { |
44 | no warnings ; |
45 | my $b ; chop $b ; |
46 | } |
47 | my $b ; chop $b ; |
48 | print STDERR "The End.\n" ; |
49 | EXPECT |
50 | Use of uninitialized value in scalar chop at - line 8. |
51 | ######## |
52 | |
53 | # Check runtime scope of pragma |
4438c4b7 |
54 | no warnings ; |
55 | { |
56 | use warnings FATAL => 'uninitialized' ; |
57 | $a = sub { my $b ; chop $b ; } |
58 | } |
59 | &$a ; |
60 | print STDERR "The End.\n" ; |
61 | EXPECT |
146174a9 |
62 | Use of uninitialized value in scalar chop at - line 6. |
4438c4b7 |
63 | ######## |
ee8c7f54 |
64 | |
65 | # Check runtime scope of pragma |
66 | no warnings ; |
67 | { |
68 | use warnings FATAL => 'all' ; |
69 | $a = sub { my $b ; chop $b ; } |
70 | } |
71 | &$a ; |
72 | print STDERR "The End.\n" ; |
73 | EXPECT |
74 | Use of uninitialized value in scalar chop at - line 6. |
75 | ######## |
4438c4b7 |
76 | |
77 | --FILE-- abc |
78 | 1 if $a EQ $b ; |
79 | 1; |
80 | --FILE-- |
81 | use warnings FATAL => 'deprecated' ; |
82 | require "./abc"; |
83 | EXPECT |
84 | |
85 | ######## |
86 | |
87 | --FILE-- abc |
88 | use warnings FATAL => 'deprecated' ; |
89 | 1; |
90 | --FILE-- |
91 | require "./abc"; |
92 | 1 if $a EQ $b ; |
93 | EXPECT |
94 | |
95 | ######## |
96 | |
97 | --FILE-- abc |
98 | use warnings 'deprecated' ; |
99 | 1 if $a EQ $b ; |
100 | 1; |
101 | --FILE-- |
102 | use warnings FATAL => 'uninitialized' ; |
103 | require "./abc"; |
104 | my $a ; chop $a ; |
105 | print STDERR "The End.\n" ; |
106 | EXPECT |
107 | Use of EQ is deprecated at ./abc line 2. |
146174a9 |
108 | Use of uninitialized value in scalar chop at - line 3. |
4438c4b7 |
109 | ######## |
110 | |
111 | --FILE-- abc.pm |
112 | use warnings 'deprecated' ; |
113 | 1 if $a EQ $b ; |
114 | 1; |
115 | --FILE-- |
116 | use warnings FATAL => 'uninitialized' ; |
117 | use abc; |
118 | my $a ; chop $a ; |
119 | print STDERR "The End.\n" ; |
120 | EXPECT |
121 | Use of EQ is deprecated at abc.pm line 2. |
146174a9 |
122 | Use of uninitialized value in scalar chop at - line 3. |
4438c4b7 |
123 | ######## |
124 | |
125 | # Check scope of pragma with eval |
126 | no warnings ; |
127 | eval { |
128 | use warnings FATAL => 'uninitialized' ; |
129 | my $b ; chop $b ; |
130 | }; print STDERR "-- $@" ; |
131 | my $b ; chop $b ; |
132 | print STDERR "The End.\n" ; |
133 | EXPECT |
146174a9 |
134 | -- Use of uninitialized value in scalar chop at - line 6. |
4438c4b7 |
135 | The End. |
136 | ######## |
137 | |
138 | # Check scope of pragma with eval |
139 | use warnings FATAL => 'uninitialized' ; |
140 | eval { |
141 | my $b ; chop $b ; |
142 | }; print STDERR "-- $@" ; |
143 | my $b ; chop $b ; |
144 | print STDERR "The End.\n" ; |
145 | EXPECT |
146174a9 |
146 | -- Use of uninitialized value in scalar chop at - line 5. |
147 | Use of uninitialized value in scalar chop at - line 7. |
4438c4b7 |
148 | ######## |
149 | |
150 | # Check scope of pragma with eval |
151 | use warnings FATAL => 'uninitialized' ; |
152 | eval { |
153 | no warnings ; |
154 | my $b ; chop $b ; |
155 | }; print STDERR $@ ; |
156 | my $b ; chop $b ; |
157 | print STDERR "The End.\n" ; |
158 | EXPECT |
146174a9 |
159 | Use of uninitialized value in scalar chop at - line 8. |
4438c4b7 |
160 | ######## |
161 | |
162 | # Check scope of pragma with eval |
163 | no warnings ; |
164 | eval { |
165 | use warnings FATAL => 'deprecated' ; |
166 | 1 if $a EQ $b ; |
167 | }; print STDERR "-- $@" ; |
168 | 1 if $a EQ $b ; |
169 | print STDERR "The End.\n" ; |
170 | EXPECT |
171 | Use of EQ is deprecated at - line 6. |
172 | ######## |
173 | |
174 | # Check scope of pragma with eval |
175 | use warnings FATAL => 'deprecated' ; |
176 | eval { |
177 | 1 if $a EQ $b ; |
178 | }; print STDERR "-- $@" ; |
179 | 1 if $a EQ $b ; |
180 | print STDERR "The End.\n" ; |
181 | EXPECT |
182 | Use of EQ is deprecated at - line 5. |
183 | ######## |
184 | |
185 | # Check scope of pragma with eval |
186 | use warnings FATAL => 'deprecated' ; |
187 | eval { |
188 | no warnings ; |
189 | 1 if $a EQ $b ; |
190 | }; print STDERR $@ ; |
191 | 1 if $a EQ $b ; |
192 | print STDERR "The End.\n" ; |
193 | EXPECT |
194 | Use of EQ is deprecated at - line 8. |
195 | ######## |
196 | |
197 | # Check scope of pragma with eval |
198 | no warnings ; |
199 | eval { |
200 | use warnings FATAL => 'deprecated' ; |
201 | }; print STDERR $@ ; |
202 | 1 if $a EQ $b ; |
203 | print STDERR "The End.\n" ; |
204 | EXPECT |
205 | The End. |
206 | ######## |
207 | |
208 | # Check scope of pragma with eval |
209 | no warnings ; |
210 | eval q[ |
211 | use warnings FATAL => 'uninitialized' ; |
212 | my $b ; chop $b ; |
213 | ]; print STDERR "-- $@"; |
214 | my $b ; chop $b ; |
215 | print STDERR "The End.\n" ; |
216 | EXPECT |
146174a9 |
217 | -- Use of uninitialized value in scalar chop at (eval 1) line 3. |
4438c4b7 |
218 | The End. |
219 | ######## |
220 | |
221 | # Check scope of pragma with eval |
222 | use warnings FATAL => 'uninitialized' ; |
223 | eval ' |
224 | my $b ; chop $b ; |
225 | '; print STDERR "-- $@" ; |
226 | my $b ; chop $b ; |
227 | print STDERR "The End.\n" ; |
228 | EXPECT |
146174a9 |
229 | -- Use of uninitialized value in scalar chop at (eval 1) line 2. |
230 | Use of uninitialized value in scalar chop at - line 7. |
4438c4b7 |
231 | ######## |
232 | |
233 | # Check scope of pragma with eval |
234 | use warnings FATAL => 'uninitialized' ; |
235 | eval ' |
236 | no warnings ; |
237 | my $b ; chop $b ; |
238 | '; print STDERR $@ ; |
239 | my $b ; chop $b ; |
240 | print STDERR "The End.\n" ; |
241 | EXPECT |
146174a9 |
242 | Use of uninitialized value in scalar chop at - line 8. |
4438c4b7 |
243 | ######## |
244 | |
245 | # Check scope of pragma with eval |
246 | no warnings ; |
247 | eval q[ |
248 | use warnings FATAL => 'deprecated' ; |
249 | 1 if $a EQ $b ; |
250 | ]; print STDERR "-- $@"; |
251 | 1 if $a EQ $b ; |
252 | print STDERR "The End.\n" ; |
253 | EXPECT |
254 | -- Use of EQ is deprecated at (eval 1) line 3. |
255 | The End. |
256 | ######## |
257 | |
258 | # Check scope of pragma with eval |
259 | use warnings FATAL => 'deprecated' ; |
260 | eval ' |
261 | 1 if $a EQ $b ; |
262 | '; print STDERR "-- $@"; |
263 | print STDERR "The End.\n" ; |
264 | EXPECT |
265 | -- Use of EQ is deprecated at (eval 1) line 2. |
266 | The End. |
267 | ######## |
268 | |
269 | # Check scope of pragma with eval |
270 | use warnings FATAL => 'deprecated' ; |
271 | eval ' |
272 | no warnings ; |
273 | 1 if $a EQ $b ; |
274 | '; print STDERR "-- $@"; |
275 | 1 if $a EQ $b ; |
276 | print STDERR "The End.\n" ; |
277 | EXPECT |
278 | Use of EQ is deprecated at - line 8. |