The implementation was tweaked to work around several limitations of vanilla C<perl> pragmas : it's thread safe, and does not suffer from a C<perl 5.8.x-5.10.0> bug that causes all pragmas to propagate into C<require>d scopes.
-C<meth $obj> (no semicolon) at the end of a file won't be seen as an indirect object syntax, although it will as soon as there is another token before the end (as in C<meth $obj;> or C<meth $obj 1>).
+Before C<perl> 5.12, C<meth $obj> (no semicolon) at the end of a file is not seen as an indirect object syntax, although it is as soon as there is another token before the end (as in C<meth $obj;> or C<meth $obj 1>).
+If you use C<perl> 5.12 or greater, those constructs are correctly reported.
With 5.8 perls, the pragma does not propagate into C<eval STRING>.
This is due to a shortcoming in the way perl handles the hints hash, which is addressed in perl 5.10.
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More tests => 2;
BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
my $status = run_perl 'no indirect; qq{a\x{100}b} =~ /\A[\x00-\x7f]*\z/;';
is $status, 0, 'RT #47866';
}
+
+SKIP:
+{
+ skip 'Fixed in core only since 5.12' => 1 unless $] >= 5.012;
+ my $status = run_perl 'no indirect hook => sub { exit 2 }; new X';
+ is $status, 2 << 8, 'no semicolon at the end of -e';
+}