my @data; while (my @line = $sth->fetchrow_array) { print "$line[2]\n"; push @data, [ @line ]; }