package Parent_object; [...] sub do_something { my $O = shift; my $f = $O->{'sub-function-for-this-case'}; $f->($O); return ([whatever]); }