dvinay has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
i have basic doubt regarding the hash references,
basically i wanted to check the emptyness of the hash
reference in my code,when there are key-value pairs i get
the correct count, but when there are no key-values
pairs, still my hash reference shows the below output
$VAR1 = \{ '' => undef };
why this undef value existing in hash reference, and
size of the hash reference returns as 1" how do i check the emptyness here.
any idea please...!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Size of an Hash reference
by choroba (Cardinal) on Nov 11, 2013 at 14:46 UTC | |
by dvinay (Acolyte) on Nov 11, 2013 at 14:53 UTC | |
by Laurent_R (Canon) on Nov 11, 2013 at 15:48 UTC | |
by dvinay (Acolyte) on Nov 11, 2013 at 16:21 UTC | |
by choroba (Cardinal) on Nov 11, 2013 at 16:27 UTC | |
by Laurent_R (Canon) on Nov 11, 2013 at 16:52 UTC | |
|
Re: Size of an Hash reference
by hippo (Archbishop) on Nov 11, 2013 at 14:44 UTC | |
|
Re: Size of an Hash reference
by LanX (Saint) on Nov 11, 2013 at 14:53 UTC | |
|
Re: Size of an Hash reference
by Anonymous Monk on Nov 11, 2013 at 14:44 UTC |