Baz has asked for the wisdom of the Perl Monks concerning the following question:
where fetchrow_array belongs to DBI$coord_{$key1}{$key2}[[2]] = $sth->fetchrow_array;
Sometimes though fetchrow_array will not find an entry, so what I want to do is store missing entries in my database as 0 in the corresponding variable. So lets say the corresponding entry for $coord_{"AB"}{5}[[2]] has no entry in the database, then I want $coord_{"AB"}{5}[[2]] = 0 instead of $coord_{"AB"}{5}[[2]] = "uninitialized value";
So I could use something like -
but how does perl represent this "uninitialized value" that I'm using above? I hope that makes sense.if($coord_{$key1}{$key2}[2] eq "uninitialized value") { $coord_{$key1}{$key2}[2] = 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use of uninitialized values
by nothingmuch (Priest) on Apr 06, 2003 at 14:13 UTC | |
|
Re: use of uninitialized values
by Anonymous Monk on Apr 06, 2003 at 14:13 UTC | |
|
Re: use of uninitialized values
by graff (Chancellor) on Apr 07, 2003 at 01:08 UTC | |
by pfaut (Priest) on Apr 07, 2003 at 03:39 UTC |