The following hash creation isn't doing what you think it is. It's creating a hash with a hash reference as its only key, and with no value (value is assigned as undef).
my %hash = { 'debt-1' => { 'debt_id' => 10, 'mobile' => 11, 'address1' => 12 }, 'dedt-2' => { 'debt_id' => 20, 'mobile' => 21, 'address1' => 22 }, };
Instead of using braces (ie. {}) to create the hash which is used to create a hash reference to an anonymous hash, you need to use parens instead:
my %hash = ( 'debt-1' => { 'debt_id' => 10, 'mobile' => 11, 'address1' => 12 }, 'dedt-2' => { 'debt_id' => 20, 'mobile' => 21, 'address1' => 22 }, );
Things should begin to fall into place after you've fixed that.
In reply to Re: Print values and keys from hash of hashes.
by stevieb
in thread Print values and keys from hash of hashes.
by Sami_R
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |