in reply to How can I keep the values in the array?

Young,
It sounds like your issue is understanding scoping. Check out Coping with Scoping for more information. What you need to do is push your individual rows on to an array that can be seen both inside and outside the scope of the while block.
my @bucket; while ( my @row = $sth ->fetchrow_array ) { print "@row\n"; push @bucket , \@row; } print "The count of the first row is :" , scalar @{ $bucket[0] }, "\n" +; print "The first row is : @{$bucket[0]}\n"; # or for all the rows you saw for my $row ( @bucket ) { print "The count in this row is :", scalar @$row, "\n"; print "The row is @$row\n"; }

Cheers - L~R