Somewhere in the "perldoc -f exists" i read:

====================================================================
Although the deepest nested array or hash will not
             spring into existence just because its existence was
             tested, any intervening ones will.  Thus
             "$ref->{"A"}" and "$ref->{"A"}->{"B"}" will spring
             into existence due to the existence test for the
             $key element above.  This happens anywhere the arrow
             operator is used, including even:

2003-06-20          Last change: perl v5.6.1                    1

User Contributed Perl Documentation                  BAA4HAI02(1)

                 undef $ref;
                 if (exists $ref->{"Some key"})      { }
                 print $ref;             # prints HASH(0x80d3d5c)

             This surprising autovivification in what does not at
             first--or even second--glance appear to be an lvalue
             context may be fixed in a future release.
======================================================================

May be..

-Sharad
-----Original Message-----
From: Eric Walker [mailto:[EMAIL PROTECTED]
Sent: Friday, June 20, 2003 2:39 PM
To: perlgroup
Subject: HASH PROBLEM!!


I have a check I am doing with a hash.  

if (exists $deref{$drcrule})


This check fails as if the keyvalue is a part of the hash, but when I
print out the keys like this
foreach my $item (%{$deref}){
  print "$item\n";
}

And it is not in the list.  I ran this on a previous data that had this
in the hash, does perl not clean the address space.  Is it possible for
this data to be lingering from that last run? 

Thanks...





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to