use strict; use Data::Dumper; sub foo { print "foo\n"; } for my $subname (@ARGV) { my $glob = $::{$subname}; warn defined $glob ? "'*$subname' exists" : "'*$subname' not found"; if ($glob) { my $sub = *{$glob}{CODE}; warn defined $sub ? "'$subname' exists" : "'$subname' not found"; &$sub if $sub }; }