use ExtUtils::MakeMaker;
WriteMakefile(
- NAME => 'Devel::GlobalDestruction',
- VERSION_FROM => 'lib/Devel/GlobalDestruction.pm',
- INSTALLDIRS => 'site',
- SIGN => 1,
- PL_FILES => { },
+ NAME => 'Devel::GlobalDestruction',
+ VERSION_FROM => 'lib/Devel/GlobalDestruction.pm',
+ INSTALLDIRS => 'site',
+ SIGN => 1,
+ PL_FILES => { },
MIN_PERL_VERSION => '5.006000',
- PREREQ_PM => {
- 'Sub::Exporter' => 0,
- 'Scope::Guard' => 0,
- },
+ PREREQ_PM => {
+ 'Sub::Exporter' => 0,
+ 'Scope::Guard' => 0,
+ },
+ ($] >= 5.013007 ? (XS => {}, C => []) : ()),
);
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__