use warnings; BEGIN { *foo = rand() < .5 ? sub { print "@_\n" } : sub ($) { print "@_\n" } } foo 27, 42; # Parsed as "foo(27,42);" or "foo(27),42;"