Sorry for the noob question but I couldn't find the answer in existing threads:
I think the common way to generate a Hash of Arrays is using square brackets, something like:
$HoA{$key} = [ @fields ]but this also works:
@{ $HoA{$key} } = @fieldsAre those exactly the same? Is the first preferred over the second for any reason?
I know the second form is used to add elements to the array using push, for instance:
push @{ $HoA{$key} }, @more_fieldsThank you.
In reply to Hash of arrays generation by nemesisgus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |