programming-examples/perl/Subroutine/output the subroutine arguments using special variable @_.pl
2019-11-15 12:59:38 +01:00

11 lines
280 B
Raku

displayArguments( "A", "B", 2, 15, 73, 2.79 );
# output the subroutine arguments using special variable @_
sub displayArguments
{
# the following loop displays each individual argument
for ( $i = 0; $i < @_; ++$i ) {
print "Argument $i: $_[ $i ]\n";
}
}