This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
documentation typo for Text::Wrap
[perl5.git] / lib / overload.pm
index 5faaad3..c02fddb 100644 (file)
@@ -73,6 +73,8 @@ 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;
@@ -87,12 +89,14 @@ sub AddrRef {
   my $package = ref $_[0];
   return "$_[0]" unless $package;
 
-       require Scalar::Util;
-       my $class = Scalar::Util::blessed($_[0]);
-       my $class_prefix = defined($class) ? "$class=" : "";
-       my $type = Scalar::Util::reftype($_[0]);
-       my $addr = Scalar::Util::refaddr($_[0]);
-       return sprintf("$class_prefix$type(0x%x)", $addr);
+  local $@;
+  local $!;
+  require Scalar::Util;
+  my $class = Scalar::Util::blessed($_[0]);
+  my $class_prefix = defined($class) ? "$class=" : "";
+  my $type = Scalar::Util::reftype($_[0]);
+  my $addr = Scalar::Util::refaddr($_[0]);
+  return sprintf("$class_prefix$type(0x%x)", $addr);
 }
 
 *StrVal = *AddrRef;