(@listc, @listd) = simplesort(\@lista, \@listb); sub simplesort { my ($listaref, $listbref ) = @_; # De-reference the array list my (@lista) = @$listaref; my (@listb) = @$listbref; # Now you can play with both arrays. }