Can someone please tell me why the following code only returns the last
element in the referenced array?  If I put the foreach routine inside the
while loop, I get a printout of each element in both the $sqlRes reference
and the $colNames reference.  But, if I print outside the while loop, I only
get the last reference put in the $sqlRes reference.  Please help.

# Reference to a set of references
my $sqlRes;

# Fetch each row of data, put into an array ref and push into the main array
ref.
while (my $colNames = $sth->fetchrow_arrayref)
    {
    push(@{$sqlRes},$colNames);
    }

foreach my $arrayRef(@{$sqlRes})
    {
    foreach my $refRef(@{$arrayRef})
        {
        print $refRef;
        print qq[<br>];
        }
    }


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to