package C; sub new { my $self = shift; my $class = ref($self) || $self; return bless {sub_ref => shift}, $class; } sub doit { $_[0]->{sub_ref}(); # you don't always need a reference to call outside of an object main::hello(); } package main; sub hello { print "hello\n"; } C->new(\&hello)->doit;