my $sub_to_test = "test_sub"; # try to fire an EVAL_ERROR eval "$sub_to_test()"; # if no EVAL_ERROR if (!$@) { # do the thing eval "$sub_to_test ('testing, 1,2,3')"; } sub test_sub { return unless @_; print "TEST_SUB: $_[0]\n"; }