{ package Foo; our $AUTOLOAD; use Carp; sub AUTOLOAD { my $self = shift; my($meth) = $AUTOLOAD =~ /.*::(.*)/; return $dispatch{$meth}->($self) if ref $dispatch{$meth}; Carp::cluck( "unknown $meth\n" ); } sub DESTROY { } # to keep this one from calling AUTOLOAD }