Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It has nothing to do with sigils. It has to do with the legacy of arrays and hashes only storing scalars in ancient Perl.

Perl 6 does not flatten by default. (And, obviously, sigils remain a core part of the language.



Short answer: Don't write $a->[0]->[0]->[0]->[0]->[0], write $a->[0][0][0][0][0]. It does the same thing.

Long answer: As for writing code, however, you don't need to write $a->[0]->[0]->[0]->[0]->[0]. After the first dereference (if any), you can omit the '->'s because arrays and hashes only store scalars so perl knows you're talking about a reference. You can use all the arrows for backwards compatibility.


The legacy of arrays and hashes only storing scalars is pretty much because of sigils.


Citation needed.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: