in reply to Checking for blank string
Hi Himaja,
Could you show us your hash with Data::Dumper? E.g. use Data::Dumper; print Dumper(\%hash);
You check for definedness with defined, e.g. if (!defined $hash{key}). One way to check for an empty string is with length, e.g. if (!length $hash{key}), but make sure to check defined first, because length(undef) will also be false (and before Perl v5.12, will throw a warning).
Hope this helps,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Checking for blank string
by Himaja (Novice) on Sep 26, 2016 at 08:46 UTC | |
by haukex (Archbishop) on Sep 26, 2016 at 09:25 UTC | |
by choroba (Cardinal) on Sep 26, 2016 at 09:52 UTC | |
by haukex (Archbishop) on Sep 26, 2016 at 10:15 UTC |