in reply to Dereferencing of data

You can simplify the $arrayref creation:
my $arrayref = [1,2,3,4,5,6,7,8]; # Note: SQUARE brackets
Yes, you can copy arrays as you have done, and yes, it will work for AoA and AoH, but, as indicated by other posters, this is not very efficient. Why not use and pass the Array ref itself ? The only down-side is the de-referencing syntax:
my $third_element = $arrayref->[2];
but you get accustomed to that pretty soon.

Once you get past the reference-passing phobia, your programs become cleaner and more efficient.
perldoc perlref is your friend.