diff options
author | Peter Scott <Peter@PSDT.com> | 2002-10-17 12:54:56 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-10-22 16:20:18 +0000 |
commit | e0fa987931295419ee9237d08014c4c5381f1cf8 (patch) | |
tree | 0341dd3cee82d70de7c90e7a6de5c1c8a7b17843 /lib/AutoLoader.pm | |
parent | 7c5b6093a3ac5e0bd09cdb0d2f391fecc26ce08d (diff) | |
download | perl-e0fa987931295419ee9237d08014c4c5381f1cf8.tar.gz |
AutoLoader gives wrong message
Message-id: <4.3.2.7.2.20021017192450.00b3dce0@shell2.webquarry.com>
p4raw-id: //depot/perl@18047
Diffstat (limited to 'lib/AutoLoader.pm')
-rw-r--r-- | lib/AutoLoader.pm | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index 3afe4af559..4352d8b1fb 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -92,23 +92,24 @@ AUTOLOAD { eval { local $SIG{__DIE__}; require $filename }; if ($@) { if (substr($sub,-9) eq '::DESTROY') { - no strict 'refs'; + no strict 'refs'; *$sub = sub {}; - } else { + $@ = undef; + } elsif ($@ =~ /^Can't locate/) { # The load might just have failed because the filename was too # long for some old SVR3 systems which treat long names as errors. - # If we can succesfully truncate a long name then it's worth a go. + # If we can successfully truncate a long name then it's worth a go. # There is a slight risk that we could pick up the wrong file here # but autosplit should have warned about that when splitting. if ($filename =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e){ eval { local $SIG{__DIE__}; require $filename }; } - if ($@){ - $@ =~ s/ at .*\n//; - my $error = $@; - require Carp; - Carp::croak($error); - } + } + if ($@){ + $@ =~ s/ at .*\n//; + my $error = $@; + require Carp; + Carp::croak($error); } } $@ = $save; @@ -124,9 +125,9 @@ sub import { # if ($pkg eq 'AutoLoader') { - no strict 'refs'; - *{ $callpkg . '::AUTOLOAD' } = \&AUTOLOAD - if @_ and $_[0] =~ /^&?AUTOLOAD$/; + no strict 'refs'; + *{ $callpkg . '::AUTOLOAD' } = \&AUTOLOAD + if @_ and $_[0] =~ /^&?AUTOLOAD$/; } # |