That the exists key word is "creating" the hash...use strict; my $self = {}; my $f1 = "aaa"; my $f2 = "bbb"; my $f3 = "ccc"; my $val = "val"; print "count = ".%$self."\n"; print "found\n" if exists $self->{$f1}{$f2}{$f3}; print "count = ".%$self."\n"; print "it is aaa\n" if exists $self->{$f1}; print "it is bbb\n" if exists $self->{$f1}{$f2}; print "it is ccc\n" if exists $self->{$f1}{$f2}{$f3}; print "count = ".%$self."\n";
Fixed code tags - dvergin 2002-07-03
In reply to hash surprise by smackdab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |