vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:
Here which one is the efficient way of passing array to a function print_array
our @foo = ("ree1", "ree2", "ree3"); print_array(*foo); my @foo = ("ree3","ree2","ree1"); print_array(\@foo); sub print_array { local (*printarr) = @_; foreach my $val (@printarr) { print "$val\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Best way to pass a array to a function
by moritz (Cardinal) on Apr 27, 2009 at 12:20 UTC | |
|
Re: Best way to pass a array to a function
by Marshall (Canon) on Apr 27, 2009 at 17:48 UTC | |
|
Re: Best way to pass a array to a function
by pemungkah (Priest) on Apr 27, 2009 at 21:07 UTC |