in reply to Re: Sne ding Information to Sub
in thread Sending Information to Sub

This works as erasei describes:       some("Foo", @alphabet); ...but be careful. You will be tempted on another occasion to do one of the following:
some(@alphabet, "Foo"); # BAD! some("Foo", @alphabet, @alpha2); # BAD!
These fail because the first array encountered in the parameter list will gobble up all the remaining values.

So you can do    some("Foo", @alphabet); and it will work because the only array in the list is the last parameter (same rule for hashes), but some would argue that it could be the beginning of a bad habit -- because later you have to be especially alert if you add another parameter for this sub.

The option is to pass a reference to the array.

some("Foo", \@alphabet); sub some { my ($one, $alpha_aref) = @_; my $letter_b = $alpha_aref->[1]; }
Thus allowing you to pass as many arrays and hashes as you may need and mix them with scalars in any order.