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.

13 lines
304 B
Raku

A prototype tells declare what types of arguments the subroutine should get.
my $a=5;
my $b=6;
my $c=7;
@list=(100,200,300);
sub myadd($$) { # myadd requires two scalar arguments
my($x, $y)=@_;
print $x + $y,"\n";
}
myadd($a, $b); # Okay
myadd(5, 4); # Okay