#!/usr.bin/perl use strict; use warnings; Foo::Bar->baz(); Foo::Bar->baz(); package UNIVERSAL; sub AUTOLOAD { my ($class, @args) = @_; our $AUTOLOAD; (my $method = $AUTOLOAD) =~ s/.*:://; print "$AUTOLOAD was called via autoload\n"; no strict 'refs'; *{$AUTOLOAD} = sub { print "I'm alive\n"}; $class->$method; }