use DynamicObject; my $object = DynamicObject -> new (); $object -> callMethod( "method" ); $object -> setMethod( "method", \&another ); $object -> callMethod( "method" ); $object -> callMethod( "fnap" ); $object -> setMethod( "fnap", \&ya ); $object -> callMethod( "fnap", qw{ Hey ho! We wont go!} ); sub another { print "This is another function!\n"; } sub ya { print "This is yet another function called with ". "arguments '", join( " ", @_ ), "'!\n"; }