$ perl -Mstrict -Mwarnings -le 'my (@x, @y); @x = ( "A", "B", "C" ); @y = ( "C", "D", "F" ); &test( \@x, \@y, ); sub test { my @test = @_; foreach my $arr ( @test ) { print "@{$arr}"; } }' A B C C D F