jason corbett wrote:
> I would like to know why this warning is coming back:
> 
> Use of uninitialized value in join or string at  line 65.

[snip]

>  while( @record= $sth->fetchrow_array( ))
> 
>         {
> 
>  my $recordlist = ' ';
>  $recordlist=join(",",@record); #This statement is causing the problem
> 
> 
> 
>   }    exit;

Jason,

Sorry if I wasn't clear in my earlier response to you. If there are NULL
values in your array, you will get this warning when you try joining the
elements of the array.

Example:

[EMAIL PROTECTED]:/usr2/local/cablemanager/etc 01:24 PM]$ perl -e 'use warnings;
use strict; my @array; $array[0] = "hi"; $array[3] = "hello"; my $string
= join(",",@array); print "$string\n";'
Use of uninitialized value in join or string at -e line 1.
Use of uninitialized value in join or string at -e line 1.
hi,,,hello


Your SELECT statement is returning NULL values. If this is expected and
you still want the "join" to concatenate the other values into a string,
then ignore the warnings. Within your while loop, throw in a "no
warnings 'uninitialized';" to quiet that warning. See:

perldoc warnings
perldoc perllexwarn

Otherwise, you'll have to clean up your SELECT statement and ensure that
all of the fields you're looking for are populated. (add WHERE clauses
and such)


Hope that helps,
- Ed

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to