You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
374 B
Perl

# Perl places all the parameters into an array named @_.
# You can access this array directly with the @_ syntax, or access individual parameters.
#!/usr/bin/perl -w
$value = add(5, 6);
print "Value from add=$value.\n";
$value = add(25, 1);
print "Value from add=$value.\n";
sub add {
my($a, $b) = @_;
my($sum) = $a + $b;
return $sum;
}