X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FUtil.pm;h=f1c08625af99da1639adabfbc4a4d462f1199ccb;hb=ae3edb8ab5e65c778ef5b85425eb772468d23b07;hp=77cbb2a9822cc6526172a684b8b3e24bcf7d0b7f;hpb=64959bc911422335c41bea9cadc584f33d6ba705;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index 77cbb2a..f1c0862 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -2,7 +2,7 @@ package Mouse::Util; use strict; use warnings; -use Exporter 'import'; +use base qw/Exporter/; use Carp; our @EXPORT_OK = qw( @@ -20,7 +20,9 @@ our %EXPORT_TAGS = ( # We only have to do this nastiness if we haven't loaded XS version of # Mouse.pm, so check if we're running under PurePerl or not BEGIN { - if ($Mouse::PurePerl) { + # Checking for undefinedness will ensure that our functions are + # properly loaded without loading Mouse, but this is kind of ugly + if ($Mouse::PurePerl || ! defined $Mouse::PurePerl) { my %dependencies = ( 'Scalar::Util' => { # VVVVV CODE TAKEN FROM SCALAR::UTIL VVVVV @@ -173,7 +175,7 @@ BEGIN { # weaken # other functions need to be loaded from our respective sources - if (defined &Scalar::Util::openhandle || eval { require Scalar::Util; 1 }) { + if (defined &Scalar::Util::openhandle) { *openhandle = \&Scalar::Util::openhandle; } else { # XXX - room for improvement