1 Check strict subs functionality
5 # no strict, should build & run ok.
14 use strict qw(refs vars);
32 Bareword "xyz" not allowed while "strict subs" in use at - line 5.
33 Execution of - aborted due to compilation errors.
40 Bareword "Fred" not allowed while "strict subs" in use at - line 4.
41 Execution of - aborted due to compilation errors.
48 Bareword "Z" not allowed while "strict subs" in use at - line 4.
49 Bareword "A" not allowed while "strict subs" in use at - line 4.
50 Execution of - aborted due to compilation errors.
57 Bareword "Y" not allowed while "strict subs" in use at - line 4.
58 Bareword "B" not allowed while "strict subs" in use at - line 4.
59 Execution of - aborted due to compilation errors.
66 Bareword "Fred" not allowed while "strict subs" in use at - line 4.
67 Execution of - aborted due to compilation errors.
70 # strict subs - no error
78 # Check compile time scope of strict subs pragma
86 Bareword "Fred" not allowed while "strict subs" in use at - line 8.
87 Execution of - aborted due to compilation errors.
90 # Check compile time scope of strict subs pragma
98 Bareword "Fred" not allowed while "strict subs" in use at - line 6.
99 Execution of - aborted due to compilation errors.
102 # Check compile time scope of strict vars pragma
110 Variable "$joe" is not imported at - line 8.
111 Global symbol "$joe" requires explicit package name at - line 8.
112 Execution of - aborted due to compilation errors.
115 # Check compile time scope of strict vars pragma
123 Global symbol "$joe" requires explicit package name at - line 6.
124 Execution of - aborted due to compilation errors.
127 # Check runtime scope of strict refs pragma
137 Can't use string ("fred") as a SCALAR ref while "strict refs" in use at - line 10.
140 # Check runtime scope of strict refs pragma
150 Can't use string ("fred") as a SCALAR ref while "strict refs" in use at - line 8.
153 # Check runtime scope of strict refs pragma
159 $a = sub { my $c = $$b ; }
163 Can't use string ("fred") as a SCALAR ref while "strict refs" in use at - line 8.
169 Bareword "Fred" not allowed while "strict subs" in use at - line 3.
170 Execution of - aborted due to compilation errors.
201 Bareword "Fred" not allowed while "strict subs" in use at ./abc line 2.
202 Compilation failed in require at - line 2.
213 Bareword "Fred" not allowed while "strict subs" in use at abc.pm line 2.
214 Compilation failed in require at - line 2.
215 BEGIN failed--compilation aborted at - line 2.
218 # Check scope of pragma with eval
229 # Check scope of pragma with eval
238 Bareword "Fred" not allowed while "strict subs" in use at - line 6.
239 Execution of - aborted due to compilation errors.
242 # Check scope of pragma with eval
250 Bareword "Fred" not allowed while "strict subs" in use at - line 5.
251 Bareword "Fred" not allowed while "strict subs" in use at - line 8.
252 Execution of - aborted due to compilation errors.
255 # Check scope of pragma with eval
264 Bareword "Fred" not allowed while "strict subs" in use at - line 9.
265 Execution of - aborted due to compilation errors.
268 # Check scope of pragma with eval
278 # Check scope of pragma with eval
285 Bareword "Fred" not allowed while "strict subs" in use at (eval 1) line 3.
288 # Check scope of pragma with eval
294 Bareword "Fred" not allowed while "strict subs" in use at (eval 1) line 2.
297 # Check scope of pragma with eval
305 Bareword "Fred" not allowed while "strict subs" in use at - line 8.
306 Execution of - aborted due to compilation errors.
309 # see if Foo->Bar(...) etc work under strictures
311 package Foo; sub Bar { print "@_\n" }
331 # Check that barewords on the RHS of a regex match are caught
335 Bareword "foo" not allowed while "strict subs" in use at - line 4.
336 Execution of - aborted due to compilation errors.
343 my $abc = XYZ ? 1 : 0;
346 Bareword "XYZ" not allowed while "strict subs" in use at - line 5.
347 Execution of - aborted due to compilation errors.
353 print "" if BAREWORD;
355 Bareword "BAREWORD" not allowed while "strict subs" in use at - line 5.
356 Execution of - aborted due to compilation errors.
362 Bareword "bad" not allowed while "strict subs" in use at - line 3.
363 Execution of - aborted due to compilation errors.
365 eval q{ use strict; no strict refs; };
368 Bareword "refs" not allowed while "strict subs" in use at (eval 1) line 1.
372 print "" if BAREWORD;
374 Bareword "BAREWORD" not allowed while "strict subs" in use at - line 3.
375 Execution of - aborted due to compilation errors.
377 # [perl #26910] hints not propagated into (?{...})
381 Bareword "foo" not allowed while "strict subs" in use at (re_eval 1) line 1.
382 Compilation failed in regexp at - line 3.