Scripting
>>
Perl
>>
How to pass array reference to a subroutine
my @myarray = ("one","two","three"); listitems(\@myarray); sub listitems() { my $theirarrayref = shift; my @theirarray = @{$theirarrayref}; foreach $item (@theirarray) { print "$item\n"; } return 0 }
Please enable JavaScript to view the
comments powered by Disqus.