use NEXT; no strict 'refs'; *{$paket . '::function'} = sub { my $this = shift; # do something $this->NEXT::function(@_); };