From: Rafael Garcia-Suarez Date: Wed, 25 Apr 2007 15:19:21 +0000 (+0000) Subject: overload must not load XS modules at compile time, or perl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4de05cebc806d4b25ef35cec05858ca1c0db23e5;p=p5sagit%2Fp5-mst-13.2.git overload must not load XS modules at compile time, or perl doesn't compile. overload must not clobber $! or $@ behind the scenes when loading an XS module. p4raw-id: //depot/perl@31076 --- diff --git a/lib/overload.pm b/lib/overload.pm index 23dbebb..c02fddb 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -2,8 +2,6 @@ package overload; our $VERSION = '1.06'; -require Scalar::Util; - sub nil {} sub OVERLOAD { @@ -75,6 +73,9 @@ sub OverloadedStringify { sub Method { my $package = shift; if(ref $package) { + local $@; + local $!; + require Scalar::Util; $package = Scalar::Util::blessed($package); return undef if !defined $package; } @@ -88,6 +89,9 @@ sub AddrRef { my $package = ref $_[0]; return "$_[0]" unless $package; + local $@; + local $!; + require Scalar::Util; my $class = Scalar::Util::blessed($_[0]); my $class_prefix = defined($class) ? "$class=" : ""; my $type = Scalar::Util::reftype($_[0]);