Check the lexical scoping of the err keyword.
(The actual behaviour is tested in t/op/dor.t)
__END__
# No err; should be a syntax error.
use warnings;
my $undef err print "Hello!\n";
EXPECT
Bareword found where operator expected at - line 3, near "$undef err"
(Missing operator before err?)
Unquoted string "err" may clash with future reserved word at - line 3.
syntax error at - line 3, near "$undef err "
Execution of - aborted due to compilation errors.
########
# With err, should work
use warnings;
use feature "err";
my $undef err print "Hello", "world";
EXPECT
Helloworld
########
# With err, should work in eval too
use warnings;
use feature "err";
eval q(my $undef err print "Hello", "world");
EXPECT
Helloworld
########
# feature out of scope; should be a syntax error.
use warnings;
{ use feature 'err'; }
my $undef err print "Hello", "world";
EXPECT
Bareword found where operator expected at - line 4, near "$undef err"
(Missing operator before err?)
Unquoted string "err" may clash with future reserved word at - line 4.
syntax error at - line 4, near "$undef err "
Execution of - aborted due to compilation errors.
########
# 'no feature' should work
use warnings;
use feature 'err';
my $undef err print "Hello", "world";
no feature;
my $undef2 err "Hello", "world";
EXPECT
Bareword found where operator expected at - line 6, near "$undef2 err"
(Missing operator before err?)
Unquoted string "err" may clash with future reserved word at - line 6.
String found where operator expected at - line 6, near "err "Hello""
(Do you need to predeclare err?)
syntax error at - line 6, near "$undef2 err "
Execution of - aborted due to compilation errors.
########
# 'no feature "err"' should work too
use warnings;
use feature 'err';
my $undef err print "Hello", "world";
no feature 'err';
$undef err print "Hello", "world";
EXPECT
Bareword found where operator expected at - line 6, near "$undef err"
(Missing operator before err?)
Unquoted string "err" may clash with future reserved word at - line 6.
syntax error at - line 6, near "$undef err "
Execution of - aborted due to compilation errors.