[Israel.pm] FW: check if hash is defined - without the keys

Chanan Berler chananb at centerity.com
Thu Jan 22 05:31:26 PST 2009


Hi All,

I got a hash with key1…key25, I am looking to know if the keys are defined
or not.
But I don't like the way like: if defined($hash{key1}) or …..
defined($hash{key5})

I also don't like much the idea of looping over the keys…
Q: is there a way to check if hash was defined or not….using the defined
function showed a warning…

PS: I can stop using the use strict / warnings – and try this if (%tvc or
%tvw) – and it works…
     But I still want to use them…

Thanks
Chanan




More information about the Perl mailing list