in reply to Pass a hash array to module

Normally, you'd pass a reference to the data structure, unless you want it flattened.

# for hashes my %hash = ( ... ); my $hashref = { ... }; # pass references: MyModule::function(\%hash); MyModule::function($hashref); # pass keys/values as a flattened list: MyModule::function(%hash); MyModule::function(%$hashref); # for arrays my @array = ( ... ); my $arrayref = [ ... ]; # pass references: MyModule::function(\@array); MyModule::function($arrayref); # pass elements as a flattened list: MyModule::function(@array); MyModule::function(@$arrayref);

When you flatten the hash/array, you'll get its entries as separate elements in the function's @_. Otherwise, there will only be one element in @_ holding the reference.