-- Morris Paterson <[EMAIL PROTECTED]> on 01/04/02 15:39:29
+0000
> why not use a NVL in your select staetment?
>
> Mitch Helle-Morrissey wrote:
>
>> Is there any way to have DBI return NULL database values as something other
>> than Perl undef? It's a pain if you're printing out a bunch of columns
>> without examining the values because printing an undef generates warnings.
>> I wrote my own function to map undefs to something else, but I was thinking
>> it would be nice to have an attribute of how NULL database values will be
>> returned to Perl. Maybe something like:
>>
>> $dbh->{NULL_VALUE} = '';
>> $dbh->{NULL_VALUE} = 'NULL';
>> $dbh->{NULL_VALUE} = undef; # current behavior
Either way you have to ||= them. This gets a bit
easier in Perl6 with the "//" operator that only
compares to undef:
$field // ''
will work properly then. Until then just use
@row = map { defined ? $_ : '' } @row;
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582