my $x = 0; while ($printrows[0][$x]) { print "First: $rows[0][$x]\n"; $x++; print "Second: $rows[0][$x]\n"; $x++; }