It seems to me that
scalar(%hash)should return 0 if the hash is empty. Similarly, another approach would be !%hash, but this appears to return false. Similarly,
doesn't work, because $#a returns 0! What am I missing/doing wrong?my @a = keys(%hash); if ($#a == -1) ...
In reply to How to test for empty hash? by scareduck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |