use strict; use warnings; package Foo; our $AUTOLOAD; sub new { return bless {}, shift } sub do_something { print "did something" } AUTOLOAD { # note it's missing the 'sub' declaration print "message from Foo: undefined method ($AUTOLOAD) called"; } package main; my $instance = Foo->new; $instance->do_something; # prints "did something" $instance->do_notimplemented; # prints "message from Foo: undefinded method (Foo::do_notimplemented) called