in reply to parameters

The first example will work, but as chipmunk says, you should use a reference if you are passing one or more arrays\hashes to a sub, otherwise it gets very difficult. Consider this:
my @fruit = ('apples', 'pears', 'bananas'); my @drinks = ('cola', 'lemonade', 'water'); foo(@fruit,@drinks);
This is not a big problem if the number of entities in @fruit and @drinks is always the same, but suppose there are different amounts of fruit or drinks each time the script runs?

With a reference you can do this:
foo(\@fruit,\@drinks); sub foo { my ($fruit,$drinks) = @_; print $fruit->[0], "\n"; print $drinks->[0], "\n"; }
This will print:
apples
cola


References are really useful but a bit daunting at first. Check perlref documentation and dive in and see what happens.

$code or die
Using perl at
The Spiders Web