my $ref = ref($foo); my $do_it2; eval "\$do_it2 = \\&${ref}::do_it"; $do_it2->('indirect call');