Either is correct. Since hash values must be scalars, perl can intuit the need to dereference for extra indexes or keys beyond the leftmost. Preference is strictly personal - use which syntax you like better.
| [reply] |
Preferred syntax? This is Perl, TMTOWTDI. That is, there is no preferred anything. There are, perhaps, caveats and some no-nos and some performance variations on occasion, but beyond this, do things the way you like. In this case, it's all syntactic sugar, so the interpreter ends up seeing the same thing whether there's a -> or not.
Personally, I find that $HASH{$key}->[$index] has a higher noise-to-signal ratio than $HASH{$key}[$index], so I prefer the latter.
| [reply] [d/l] [select] |