in reply to Reliably checking that something doesn't exist

use exists instead of defined?
unless (exists($FDomainName->{WEBFWD}) ) { $FDomainName->{WEBSPACE}= 'TRUE' if exist($FDomainName->{DocumentR +oot}) }

--

Brother Frankus.

¤

Replies are listed 'Best First'.
Re: Re: Reliably checking that something doesn't exist
by ritontor (Acolyte) on Nov 26, 2001 at 21:09 UTC
    Nope, still does the same thing, sets $FDomainName->{WEBSPACE}= 'TRUE'. I'm still printing $FDomainName->{WEBFWD} and it still has its URL in it :)

    Just for further clarification, if ( $FDomainName->{ WEBSPACE }  =~ /TRUE/ ) { foo } is how i'm checking to see if it's been set.
      hmm works for me:
      #!/usr/bin/perl -w use strict; use Data::Dumper; $_ = { foo=>1, bar=>2, baz=>3}; print Dumper $_; print "Wahey!\n" if exists($_->{foo})
      is the variable being declared inside the loop, or outside in which case it may be retaining values.

      --

      Brother Frankus.

      ¤