Hi,
when a hash is defined with a reference , it's value is obtained by dereferencing using ->. Here keys of hash is referencing to a hash. so while dereferencing, why is it allowing $hash->{a}{1} as it should allow only $hash->{a}->{1} $hash={a=>{1=>2}};
print "ref($hash->{a})"; #says its an hash reference print "$hash->{a}->{1}" ;#returns 2 as expected print "$hash->{a}{1}"; #also returns 2 ,my question is how without der +eferencing the key of $hash->{a} its value is getting displayed?
2019-03-07 Athanasius added paragraph and code tags
In reply to Query on References by Arunkumar_141
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |