perl -wle' sub test {  print "test" } my $x = "test"; if (my $code = main->can($x)) {  $code->() }' test