sub bar { print 'woot' } for my $thing (qw/ foo bar /){ print "$thing :$/"; eval{ no strict refs; &{$thing}(@_); # possibly a nasty symbolic reference }; warn "You can not call $thing: $@ " if $@; } #### foo : You can not call foo: Undefined subroutine &main::foo called at call line 7. at call line 9. bar : woot