Meh, ignore me.
That just shows that $data->{$id}{HOST} exists, but has an undefined value. This little bit should help sort things out for you. I'm thinking maybe you have a case similar to GONE.
$ cat t.pl use strict; use warnings; my $data = { FOO=>{HOST=>undef, BANG=>3}}; for my $K (qw(HOST BANG GONE)) { print "$K exists\n" if exists $data->{FOO}{$K}; print "$K defined\n" if defined $data->{FOO}{$K}; print "$K val==''\n" if $data->{FOO}{$K} eq ""; } $ perl t.pl HOST exists Use of uninitialized value in string eq at t.pl line 9. HOST val=='' BANG exists BANG defined Use of uninitialized value in string eq at t.pl line 9. GONE val==''
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: if not defined question
by roboticus
in thread if not defined question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |