my $package_method = 'Foo::Bar::baz'; my $orig = \&($package_method}; no warnings; *{$package_method} = sub { pre(); $orig->(@_); post() };