Piece of advice. If you know the names of all of the routines, and they are repetitive enough to AUTOLOAD, why not create them in advance by assigning closures to the symbol table? That is rather than something like this:
sub AUTOLOAD { my @name_pieces = split /::/, $AUTOLOAD; my $function = pop @name_pieces; my $package = join "::", @name_pieces; no strict 'refs'; *{"$package\::$function"} = get_sub($package, $function); goto &{"$package\::$function"}; }
You write something like this:
for my $package (@packages) { for my $function (@functions) { no strict 'refs'; *{"$package\::$function"} = get_sub($package, $function); } }
and now there is no need to write an AUTOLOAD. Which means that chromatic doesn't complain that can doesn't do the right thing, your AUTOLOAD doesn't break when it sees functions you didn't mean to catch, you don't blow the method cache a bunch of times, and life is generally better.

In reply to Re: Autoloading tie routines by tilly
in thread Autoloading tie routines by cmac

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.