programming-examples/perl/Subroutine/Subroutine parameter default value.pl
2019-11-15 12:59:38 +01:00

15 lines
258 B
Perl

sub addem
{
my %hash =
(
OPERAND1 => 2,
OPERAND2 => 3,
@_,
);
return $hash{OPERAND1} + $hash{OPERAND2};
}
print "The result is: " . addem();
print "\n";
print "The result is: " . addem(OPERAND1 => 3);