In \"Perl Best Practices\" the very first line in the section on AUTOLOAD is:
Don\'t use AUTOLOAD
However all t
I think for a stand alone script this approach is OK. You can create subroutines on the fly to speed up subsequent calls, e.g.:
sub AUTOLOAD {
(my $name = our $AUTOLOAD) =~ s/.*:://;
no strict 'refs'; # allow symbolic references
*$AUTOLOAD = sub { print "$name subroutine called\n" };
goto &$AUTOLOAD; # jump to the new sub
}
Autoloading is tricky when producing inheritance trees.