diff options
Diffstat (limited to 'dist/Safe')
-rw-r--r-- | dist/Safe/Safe.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dist/Safe/Safe.pm b/dist/Safe/Safe.pm index e33598ea2a..cc872802b1 100644 --- a/dist/Safe/Safe.pm +++ b/dist/Safe/Safe.pm @@ -3,7 +3,6 @@ package Safe; use 5.003_11; use strict; use Scalar::Util qw(reftype); -use B qw(sub_generation); $Safe::VERSION = "2.25"; @@ -32,6 +31,18 @@ BEGIN { eval q{ use Carp::Heavy; } } +use B (); +BEGIN { + no strict 'refs'; + if (defined &B::sub_generation) { + *sub_generation = \&B::sub_generation; + } + else { + # fake sub generation changing for perls < 5.8.9 + my $sg; *sub_generation = sub { ++$sg }; + } +} + use Opcode 1.01, qw( opset opset_to_ops opmask_add empty_opset full_opset invert_opset verify_opset |