in reply to Re: compare values within hash
in thread compare values within hash
Using exists on array elements makes no sense. The information it returns is useless.
my @a; $a[1] = undef; $a[2] = 'foo'; print("0: ", exists($a[0]) ?1:0,"\n"); # 0 print("1: ", exists($a[1]) ?1:0,"\n"); # 1 print("3: ", exists($a[3]) ?1:0,"\n"); # 0
exists $a2[$i] should be $i < @a2 or defined $a2[$i] depending on what you were trying to accomplish.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: compare values within hash
by toolic (Bishop) on Nov 23, 2008 at 18:07 UTC | |
by ikegami (Patriarch) on Nov 23, 2008 at 18:55 UTC |