sub AUTOLOAD { # Filter out package information. (my $name = $AUTOLOAD) =~ s/.*:://; if (exists $subs{$name}) { *$AUTOLOAD = sub {$subs{$name}}; # This wont work! why? eval "sub $AUTOLOAD {$subs{$name}}"; # this will... fatalError("A compile error occurred while compiling the subroutine $AUTOLOAD: $@") if $@; } else { fatalError("The undefined subroutine $AUTOLOAD was called."); } delete $subs{$name}; goto &$AUTOLOAD; }