in reply to What is autoloading?

When Perl dispatches a method call, it may not find an appropriate method to invoke. In that case, it will dispatch to a special method called AUTOLOAD as a last resort. This allows you to do whatever's appropriate for your class in the case of a missing method.

You can catch errors in this fashion or write really simple proxy or delegation systems. Some code uses this to compile code as necessary, but that's not really as useful in my opinion.

Replies are listed 'Best First'.
Re^2: What is autoloading?
by shmem (Chancellor) on Nov 25, 2007 at 13:49 UTC
    Some code uses this to compile code as necessary, but that's not really as useful in my opinion.

    It is useful if you have a module with lots of functions, of which you will need only some, e.g. POSIX.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}