in reply to Re: Defined vs. undefined
in thread Defined vs. undefined
To clarify - unlike scalars, arrays and hashes can't be "undefined". They can be empty, which is slightly different.
monarch, to test for emptiness, you said:
If the hash is empty then (@keyarr == 1).
I think you mean 0 not 1:
my %hash; my @keyarr = keys %hash; print scalar @keyarr;
prints 0.
|
|---|