smartyollie has asked for the wisdom of the Perl Monks concerning the following question:
from dumping the structure using Data::Dumper:
'QUESTION_TEXT' => {},
I've tried various ways to identify that null hash element but no luck.
my $value = $hh{'QUESTION_TEXT'}; if (CHECKSOMETHING) { print "$value"; } else { print "NULL"; }
It always prints something like HASH(0x31f4348), i.e. it appears the else clause is never executing. for CHECKSOMETHING I've tried the following, but nothing ends up executing the ELSE case:
if ($value ne '') if (defined($value) if (exists($value) if (!($value =~ /[a-zA-Z0-9]/)) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to identify a null hash value
by kcott (Archbishop) on Jun 04, 2015 at 22:47 UTC | |
by smartyollie (Novice) on Jun 05, 2015 at 17:13 UTC | |
by kcott (Archbishop) on Jun 10, 2015 at 18:27 UTC | |
|
Re: how to identify a null hash value
by stevieb (Canon) on Jun 04, 2015 at 20:29 UTC | |
by smartyollie (Novice) on Jun 04, 2015 at 20:40 UTC | |
by stevieb (Canon) on Jun 04, 2015 at 20:55 UTC | |
by smartyollie (Novice) on Jun 04, 2015 at 21:32 UTC | |
by stevieb (Canon) on Jun 04, 2015 at 21:52 UTC | |
| |
|
Re: how to identify a null hash value
by Hosen1989 (Scribe) on Jun 05, 2015 at 08:41 UTC | |
by smartyollie (Novice) on Jun 05, 2015 at 17:16 UTC | |
by AnomalousMonk (Archbishop) on Jun 05, 2015 at 18:04 UTC |