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

Strange, for me it's the opposite.

Just yesterday, I moved some 100 lines of code using a hash quite a few times from the main module to a function using a reference to the hash.

if %args is the hash holding the data, '$args{key}' tells me the value of 'key' in the main module.

a reference to the hash passed to the function is noted like so : '$args = \%args';$args->{key} tells me value of 'key'

All I had to do to adapt the code was to replace '$args{' with '$args->{', done by the time I typed the replace command in my editor.

Funny that it just makes sense to me, must be something with the brain's wiring.



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

Search: