programming-examples/perl/Subroutine/Declaration with prototype.pl
2019-11-15 12:59:38 +01:00

11 lines
276 B
Raku

sub mynumbs(@$;$); # Declaration with prototype
@list=(1,2,3);
mynumbs(@list, 25);
sub mynumbs(@$;$) { # Match the prototypes
my ($scalar)=pop(@_);
my(@arr) = @_;
print "The array is: @arr","\n";
print "The scalar is $scalar\n";
}