Also don't wrap the code inside a real block, as this changes the behaviour
of last and redo.
my @errs;
my $wrapper = <<" WRAPPER";
my @errs;
my $wrapper = <<" WRAPPER";
- no indirect hook => sub { push \@errs, [ \@_ ] };
- {
- ;
+ my \$hook;
+ BEGIN { \$hook = sub { push \@errs, [ \@_ ] } }
+ no strict;
+ no warnings;
+ no indirect hook => \$hook;
+ do {
WRAPPER
{
local ($@, *_);
eval $wrapper; ## no critic
WRAPPER
{
local ($@, *_);
eval $wrapper; ## no critic
- Carp::confess("Couldn't compile the source wrapper: $@");
+ Carp::croak("Couldn't compile the source wrapper: $err");
my ($tests, $reports, $subtests);
BEGIN {
my ($tests, $reports, $subtests);
BEGIN {
- $tests = 27;
- $reports = 42;
+ $tests = 28;
+ $reports = 43;
my $x = meh { new $obj } new X;
----
[ 'meh', '{', 2, 9 ], [ 'new', '$obj', 2, 15 ], [ 'new', 'X', 2, 26 ]
my $x = meh { new $obj } new X;
----
[ 'meh', '{', 2, 9 ], [ 'new', '$obj', 2, 15 ], [ 'new', 'X', 2, 26 ]
+####
+my $x = $invalid_global_when_strict_is_on; new X;
+----
+[ 'new', 'X', 1, 44 ]