Attached patch Sub-Uplevel-0.22-74677-01.patch seems to do it. Works
with old and new bleadperl. Also tested with 5.14.2 and 5.12.4.
diff -ru /home/sand/.cpan/build/Sub-Uplevel-0.22-vNnirS~/t/02_uplevel.t /home/sand/.cpan/build/Sub-Uplevel-0.22-vNnirS/t/02_uplevel.t
--- /home/sand/.cpan/build/Sub-Uplevel-0.22-vNnirS~/t/02_uplevel.t 2009-11-17 11:39:43.000000000 +0100
+++ /home/sand/.cpan/build/Sub-Uplevel-0.22-vNnirS/t/02_uplevel.t 2012-02-07 04:53:45.844937901 +0100
@@ -81,6 +81,7 @@
Now we can fool croak! at $0 line 64
main::wrap_croak(1) called at $0 line 72
CARP
+$croak_regex =~ s/64/64\.?/;
$croak_regex .= '\t(require 0|eval \{\.\.\.\})'
. quotemeta( " called at $0 line 72" );
like( $@, "/$croak_regex/", 'croak() fooled');
@@ -92,6 +93,7 @@
$croak_regex = quotemeta( <<"CARP" );
Now we can fool croak! at $0 line 64
CARP
+$croak_regex =~ s/64/64\.?/;
like( $@, "/$croak_regex/", 'croak() fooled');
#line 79
@@ -119,10 +121,12 @@
#line 98
wrap_carp();
}
-is( $warning, <<CARP, 'carp() fooled' );
+my $carp_regex = quotemeta( <<"CARP" );
HA! Even carp is fooled! at $0 line 88
main::wrap_carp() called at $0 line 98
CARP
+$carp_regex =~ s/88/88\.?/;
+like( $warning, "/$carp_regex/", 'carp() fooled' );
use Foo;