I am using a third-party module that uses AUTOLOAD to allow you to call options in a "convenient" way.

The autoload isn't needed -- you can set the options with an explicit $obj->options() method, but the author I guess thought it'd be nice to allow $obj->some_random_option() calls and used AUTOLOAD for this.

Yuck.

And the author's AUTOLOAD doesn't check anything, it just dispatches everything to  $obj->option(some_random_option=>blah blah), without checking if  some_random_option is supported.

I'm encountering some errors in the module, which I don't fully understand yet, which lead to the objects unexpected demise, which leads to a DESTROY call, which AUTOLOAD happily dispatches to options.

Yuck again.

Is there a way for me, while debugging, to mangle the symbol table to remove Foo::Bar::Baz::AUTOLOAD subroutine?

I do not / can not modify Foo/Bar/Baz.pm.

Thanks!

water

PS I think I recall in Damian's PBP Dog book, he states AUTOLOADs are bad, and I agree! Too much magick.


In reply to removing someone elses AUTOLOAD by water

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.