int product (int x, int y) {
return x * y;
}
char *product (char *company, int prodID) {
/*
magic to return name of product
related to prodID in the given company
*/
}
####
sub foo {
die "foo() needs at least one argument" if !@_;
(my($x,$), local($z)) = @_;
$y ||= 10;
$z ||= $x * $y;
# ...
}
####
sub foo (
my($x) :req,
my($y) ||= 10,
local($z) ||= ($x * $y)
) {
# ...
}