>>>>> "Michelle" == Michelle Gerfort <[EMAIL PROTECTED]> writes:

Michelle> I'm having a problem when using fetchrow_array().

When I worry about NULLs in column, I find that using plain old
"fetch" lets me construct a much simpler outer loop.  If I need to
grab individual elements later, or build a hash, I can do that
manually with little pain.

As for handling NULL values individually, I tend to use a 'map' that
replaces actual NULL/undef values with a string that makes it
explicit.  In the simplified example you give, I'd consider:

| while (my $cur = $sth->fetch())
| {
|     print join("\t", map { defined $_ ? $_ : '<NULL>' } @$cur), "\n";
| }

This handles the end-of-set condition ($cur will be undef, so the
'while' loop will end), and any NULLs are changed into a literal
string that is easy to search for.

t.

Reply via email to