[tpm] dereferencing anonymous hashes

adam.prime at utoronto.ca adam.prime at utoronto.ca
Tue Apr 10 12:41:24 PDT 2007

Quoting Fulko Hew <fulko.hew at gmail.com>:

> The question should have been... whats the difference between:
> %x = ();  and
> %x = {};

the first one is a normal assignment to a hash, the second one, i'm  
guessing is an assignment of a reference to a hash '{}' to a hash, so  
you get a hash with one key (the address of the anonymous hash) who's  
value is undef.

Basically you probably never (or rarely) want to do the second one.


More information about the toronto-pm mailing list