Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
When I look at line 27 in AutoLoader.pm, I find the followingUse of uninitialized value in require at //ms/dist/perl5/PROJ/AutoLoad +er/5.68/lib/perl5/AutoLoader.pm line 27 during global destruction. Use of uninitialized value in require at //ms/dist/perl5/PROJ/AutoLoad +er/5.68/lib/perl5/AutoLoader.pm line 27 during global destruction. Use of uninitialized value in require at //ms/dist/perl5/PROJ/AutoLoad +er/5.68/lib/perl5/AutoLoader.pm line 27 during global destruction. Use of uninitialized value in require at //ms/dist/perl5/PROJ/AutoLoad +er/5.68/lib/perl5/AutoLoader.pm line 27 during global destruction.
when I put a breakpoint in AutoLoader::AUTOLOAD, the missing function seems to be A::DESTROY. So, I tried putting a DESTROY method in A (not sure what code should go in there). This resulted in AutoLoader::AUTOLOAD not getting called, but the error/warning still showing up (this is puzzling). Can anyone help me ? thanks, MichaelAUTOLOAD { my $sub = $AUTOLOAD; my $filename = AutoLoader::find_filename( $sub ); my $save = $@; local $!; # Do not munge the value. eval { local $SIG{__DIE__}; require $filename }; ## line 27!!!! if ($@) { if (substr($sub,-9) eq '::DESTROY') { no strict 'refs'; *$sub = sub {}; $@ = 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 successfully truncate a long name then it's wo +rth a go. # There is a slight risk that we could pick up the wrong f +ile here # but autosplit should have warned about that when splitti +ng. 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); } } $@ = $save; goto &$sub; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AutoLoader destroy issue
by Khen1950fx (Canon) on Aug 07, 2012 at 22:00 UTC | |
by Anonymous Monk on Aug 07, 2012 at 22:30 UTC | |
|
Re: AutoLoader destroy issue (inheritance--)
by tye (Sage) on Aug 07, 2012 at 23:05 UTC | |
by MidLifeXis (Monsignor) on Aug 09, 2012 at 09:16 UTC | |
by Anonymous Monk on Aug 08, 2012 at 01:13 UTC | |
by Anonymous Monk on Aug 08, 2012 at 03:02 UTC |