"be consistent" | |
PerlMonks |
Re: Confused on Scalar/Hashby stevieb (Canon) |
on Apr 02, 2018 at 15:34 UTC ( [id://1212174]=note: print w/replies, xml ) | Need Help?? |
That's a scalar that contains a reference to a hash. Observe (untested):
The coder just skipped the intermediary step of taking a reference to the hash, and instead constructed it as a hash reference directly. To get information from the hash as I depicted above, you access it normally:
In the case of the hash reference, you have to dereference first:
You can dereference the entire hash reference and put it into a new hash if you please, but there's not often reason to do so unless you need a copy of the entire structure:
See perlreftut.
In Section
Seekers of Perl Wisdom
|
|