Hi monks, I have a MyOwnTable class which inherits from Data::Table and several derived classes (for example, A) which inherit from MyOwnTable. When I create an instance of A, perform some operations on A (which are not necessary, btw), and then exit the script, I get the following warnings
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. 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 look at line 27 in AutoLoader.pm, I find the following
AUTOLOAD { 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; }
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, Michael

In reply to AutoLoader destroy issue by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.