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.

Babs





-----Ursprüngliche Nachricht-----
Von: news [mailto:[EMAIL PROTECTED] Im Auftrag von Udo Rader
Gesendet: Samstag, 23. August 2003 13:00
An: [EMAIL PROTECTED]
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
here.

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

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

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

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

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

happy hacking

udo


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html





--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to