sub foo { die "foo() needs at least one argument" if !@_; (my($x,$), local($z)) = @_; $y ||= 10; $z ||= $x * $y; # ... }