1 Check the lexical scoping of the err keyword.
2 (The actual behaviour is tested in t/op/dor.t)
5 # No err; should be a syntax error.
7 my $undef err print "Hello!\n";
9 Bareword found where operator expected at - line 3, near "$undef err"
10 (Missing operator before err?)
11 Unquoted string "err" may clash with future reserved word at - line 3.
12 syntax error at - line 3, near "$undef err "
13 Execution of - aborted due to compilation errors.
15 # With err, should work
18 my $undef err print "Hello", "world";
22 # With err, should work in eval too
25 eval q(my $undef err print "Hello", "world");
29 # feature out of scope; should be a syntax error.
31 { use feature 'err'; }
32 my $undef err print "Hello", "world";
34 Bareword found where operator expected at - line 4, near "$undef err"
35 (Missing operator before err?)
36 Unquoted string "err" may clash with future reserved word at - line 4.
37 syntax error at - line 4, near "$undef err "
38 Execution of - aborted due to compilation errors.
40 # 'no feature' should work
43 my $undef err print "Hello", "world";
45 my $undef2 err "Hello", "world";
47 Bareword found where operator expected at - line 6, near "$undef2 err"
48 (Missing operator before err?)
49 Unquoted string "err" may clash with future reserved word at - line 6.
50 String found where operator expected at - line 6, near "err "Hello""
51 (Do you need to predeclare err?)
52 syntax error at - line 6, near "$undef2 err "
53 Execution of - aborted due to compilation errors.
55 # 'no feature "err"' should work too
58 my $undef err print "Hello", "world";
60 $undef err print "Hello", "world";
62 Bareword found where operator expected at - line 6, near "$undef err"
63 (Missing operator before err?)
64 Unquoted string "err" may clash with future reserved word at - line 6.
65 syntax error at - line 6, near "$undef err "
66 Execution of - aborted due to compilation errors.