From: Yuval Kogman Date: Wed, 21 Apr 2010 22:36:46 +0000 (+0300) Subject: avoid borging XSLoader errors X-Git-Tag: Devel-GlobalDestruction-0.03~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f615b0ff13c3d7547cca03c37f2877bb8307b709;p=p5sagit%2FDevel-GlobalDestruction.git avoid borging XSLoader errors --- diff --git a/lib/Devel/GlobalDestruction.pm b/lib/Devel/GlobalDestruction.pm index 901f1ad..d242727 100644 --- a/lib/Devel/GlobalDestruction.pm +++ b/lib/Devel/GlobalDestruction.pm @@ -10,17 +10,14 @@ use vars qw($VERSION @ISA); BEGIN { $VERSION = '0.02'; - local $@; - eval { - require XSLoader; + if ( do { local $@; eval { require XSLoader; 1 } } ) { __PACKAGE__->XSLoader::load($VERSION); - 1; - } or do { + } else { require DynaLoader; push @ISA, 'DynaLoader'; __PACKAGE__->bootstrap($VERSION); - }; + } } use Sub::Exporter -setup => {