Re:The four noisy horsemen of Perl hate
by 2OEH8eoCRo0 on Wednesday July 21, 2021 @09:43AM
(#27906120)
addresses is an array reference with two anonymous hash reference elements.
[ Parent
| on HN ]
So if it's an array, why isn't it @addresses?
It's an array reference. If you replaced the [ ... ] with ( ... ) you'd have an array and use @. This is something I see people new to Perl struggle with, and I remember it taking me some time to grasp back in the day. It's pretty natural to me now, but I do feel it's something of a wart in the language.
References are scalars in Perl. @$ dereferences an array ref and %$ derefs a hash ref. You can also reference a scalar in Perl and deref it with $$ but I never understood why you would want to.