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"; } }
In reply to Best way to pass a array to a function by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |