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

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.



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

Search: