X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FGlobalDestruction.pm;h=5fe7e890d8b39bc4198c229348d20e725c646380;hb=3790e928b4bd943715ef246f1b447190c3d162e1;hp=b8385b78162a3c0ee08059be01c5f1d5cc7ce730;hpb=8801e4f573446f7dcdcc4320f926872074484b44;p=p5sagit%2FDevel-GlobalDestruction.git diff --git a/lib/Devel/GlobalDestruction.pm b/lib/Devel/GlobalDestruction.pm index b8385b7..5fe7e89 100644 --- a/lib/Devel/GlobalDestruction.pm +++ b/lib/Devel/GlobalDestruction.pm @@ -9,13 +9,18 @@ use XSLoader; our $VERSION = '0.02'; -XSLoader::load(__PACKAGE__, $VERSION); - use Sub::Exporter -setup => { exports => [ qw(in_global_destruction) ], groups => { default => [ -all ] }, }; +if ($] >= 5.013007) { + eval 'sub in_global_destruction () { ${^GLOBAL_PHASE} eq q[DESTRUCT] }'; +} +else { + XSLoader::load(__PACKAGE__, $VERSION); +} + __PACKAGE__ __END__