in reply to Reliably checking that something doesn't exist
Actually, frankus is correct that you typically wants exists instead of defined when testing for the existence of a hash or array element. However, if you are truly needing defined, then your code is correct. As for the code you have shown us, I think we need more code to figure out what's wrong. Oh, and since the second if is dependant on the first, why not combine them? It's clearer to read (I left defined in on the off chance that this is really what you need):
if ( ! defined $FDomainName->{ WEBFWD } and defined $FDomainName->{ Do +cumentRoot } ) { $FDomainName->{ WEBSPACE } = "TRUE"; }
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|