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

This is why we use strict! The extra arrow is unneeded, as you're working on the actual hash, not a reference to the hash. This is a compiler error with use strict though, so it's not something you would generally be bitten with when writing real code, just internet comments. :)


Whoops, good catch! I had references on the brain. For completeness, that makes it either

    $nested{$x}{$y}{$z}
or after initializing with curly brackets rather than parentheses to construct a new reference to an anonymous hash

    $nested = { … };
and then use the arrow to dereference as in the grandparent.




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

Search: