Remove old Pod::Man parser creation.
[p5sagit/p5-mst-13.2.git] / t / lib / feature / err
CommitLineData
bc9b29db 1Check the lexical scoping of the err keyword.
2(The actual behaviour is tested in t/op/dor.t)
3
4__END__
5# No err; should be a syntax error.
6use warnings;
7my $undef err print "Hello!\n";
8EXPECT
9Bareword found where operator expected at - line 3, near "$undef err"
10 (Missing operator before err?)
11Unquoted string "err" may clash with future reserved word at - line 3.
12syntax error at - line 3, near "$undef err "
13Execution of - aborted due to compilation errors.
14########
15# With err, should work
16use warnings;
17use feature "err";
18my $undef err print "Hello", "world";
19EXPECT
20Helloworld
21########
22# With err, should work in eval too
23use warnings;
24use feature "err";
25eval q(my $undef err print "Hello", "world");
26EXPECT
27Helloworld
28########
29# feature out of scope; should be a syntax error.
30use warnings;
31{ use feature 'err'; }
32my $undef err print "Hello", "world";
33EXPECT
34Bareword found where operator expected at - line 4, near "$undef err"
35 (Missing operator before err?)
36Unquoted string "err" may clash with future reserved word at - line 4.
37syntax error at - line 4, near "$undef err "
38Execution of - aborted due to compilation errors.
39########
40# 'no feature' should work
41use warnings;
42use feature 'err';
43my $undef err print "Hello", "world";
44no feature;
45my $undef2 err "Hello", "world";
46EXPECT
47Bareword found where operator expected at - line 6, near "$undef2 err"
48 (Missing operator before err?)
49Unquoted string "err" may clash with future reserved word at - line 6.
50String found where operator expected at - line 6, near "err "Hello""
51 (Do you need to predeclare err?)
52syntax error at - line 6, near "$undef2 err "
53Execution of - aborted due to compilation errors.
54########
55# 'no feature "err"' should work too
56use warnings;
57use feature 'err';
58my $undef err print "Hello", "world";
59no feature 'err';
60$undef err print "Hello", "world";
61EXPECT
62Bareword found where operator expected at - line 6, near "$undef err"
63 (Missing operator before err?)
64Unquoted string "err" may clash with future reserved word at - line 6.
65syntax error at - line 6, near "$undef err "
66Execution of - aborted due to compilation errors.