perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "B. Fongo" <>
Subject AW: Use of uninitialized valued in concatenation....
Date Sat, 23 Aug 2003 17:54:32 GMT
OK Guys!

Thanks for all the contributions. All along, I thought mod_perl was
complaining that $_ isn't initialized. Most of the suggestions I got
points to the array (@table_data) in the loop. It is actually true that
the some of the values of the array are NULL. 

Thanks again for all those suggestions.


-----Urspr√ľngliche Nachricht-----
Von: news [] Im Auftrag von Udo Rader
Gesendet: Samstag, 23. August 2003 13:00
Betreff: Re: AW: AW: Use of uninitialized valued in concatenation....

Am Sat, 23 Aug 2003 09:48:05 +0000 schrieb B. Fongo:
>       foreach (@table_data)
>       {
>            print qq(<td bgcolor='#d0d0d0'>$_</td>); # Here is line 42
>       }

as Frank already pointed out, your trouble is the uninitialized $_ value
you have in line 42 (which is exactly what the warning tells you, BTW).

the reason for this is very probably that @table_data contains items
that have not been initialized (=> they have no value, not even an
empty value assigned to them). @table_data is filled from
database, so _check your database_. I bet you will find "null" values in

if you don't want to output anything if the database delivers such a
value simply replace your line 42 with

print qq(<td bgcolor='#d0d0d0'>$_</td>) if $_;

if you want to output an empty line for null values, then do as Frank

my $val=$_||'NULL'; print qq(<td DEFANGED_bgcolor="0#d0d0d0">$val</td>);

and no, this has definitively absolute nothing to do with mod_perl,
just expected and normal perl behaviour.

happy hacking


Reporting bugs:
Mail list info:

Reporting bugs:
Mail list info:

View raw message