sub fooge { my ($foo, $bar) = @_; die "fooge() needs two arguments\n" unless (@_ == 2); # ... }