in reply to Testing Hash Arrays
I cant figure out why this doesnt work...
I can't figure ou what you are trying to do.
while (EXPR) { ... } do (EXPR) { ... }
is not even close to valid Perl. I think you need to reread perlsyn before proceeding.
Also, you should use $data{key}, not @data{key}.
@data{value} != "" || null
is also quite wrong.
Fix the sigil:
$data{value} != "" || null
Use ne for string comparisons:
$data{value} ne "" || null
You can't do $var == value || value. It needs to be expanded to $var == value || $val == value:
$data{value} ne "" || $data{value} == null
The logic makes no sense. Fixed:
$data{value} ne "" && $data{value} != null
Use defined to check if something is not null: (It's called undef in Perl.)
$data{value} ne "" && defined($data{value}
You need to check defined first to avoid a warning:
defined($data{value}) && $data{value} ne ""
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing Hash Arrays
by Snowman11 (Novice) on Jun 27, 2005 at 16:32 UTC | |
by ikegami (Patriarch) on Jun 27, 2005 at 16:58 UTC | |
by Snowman11 (Novice) on Jun 27, 2005 at 17:15 UTC |