sub test { ... } ; ... if ( my $s = get_sub_by_name( "", "test" ) ) { $s->() ; } else { print "No\n" ; }