in reply to How do I test the validity of a CODE reference?

Using '*foo{THING}'-notation (access to symbol table) seems to work:
#!/usr/bin/perl use strict; sub foo { print defined $_[0] ? "It is me, $_[1]!\n" : "$_[1] does no live here.\n"; } my $sub = *nonfoo{CODE}; foo($sub, "nonfoo"); $sub = *foo{CODE}; foo($sub, "foo"); __END__ nonfoo does no live here. It is me, foo!