http://www.perlmonks.org?node_id=228852


in reply to Pass local array by reference?

Maybe something like the following can help you... Untested:

#!/usr/bin/perl -w use strict; sub foo { my $array = shift; print join(",", @{$array}), "\n"; } sub bar { my $array = shift; return reverse @{$array}; } my @array = ('foo', 'bar', 'qux'); my @bar = bar( \@array ); foo( \@bar );