in reply to dereference hash

Whenever I see code like: print $$hash_ref{$key}; I have to think hard as to whether that is equivalent to:

print ${ $hash_ref }{ $key };

Or:

print ${ $hash_ref{ $key } };

With the second form, I don't have that indecision.

In a similar vein, given this sub:

sub x{ print $$_[0][1] };;

What do you think these two calls print?:

x( [['a','b'],['c','d']] );; x( ['a','b'],['c','d'] );;

Produces:

Is it clearer if the sub is defined this way?:

sub x{ print $_[0]->[1] };; xx( [['a','b'],['c','d']] );; xx( ['a','b'],['c','d'] );;

Produces:


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!