Hacker News new | ask | show | jobs
by sloucher 1800 days ago
So if it's an array, why isn't it @addresses?
2 comments

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.