in reply to Re^2: Array of arrays
in thread Array of arrays

Well, this part I think you know:
my @row; while ( @row = $sth_C->fetchrow_array ) { undef @row; }
So that leaves what's happening with each @row inside the loop.
my $krow = join "\0", @row;
Here (above), I'm constructing a single string to represent the contents of the entire row. It's fairly expensive, in the sense that the contents of the entire row are duplicated. So if the row contains a kilobyte of data, $krow will too.

This string is going to be used as a key in a hash. In fact, that's why I had to make a string: so I could index a hash with the data in an array.
$seen{$krow}++ and next;
Here, I'm attempting to access an element of the hash using the key string I generated. The value of such an element is going to be interpreted as a number, because ++ only works on numbers. (Actually that's not quite true; but the exception doesn't concern us now.)

If no such element is found, it is created first, and the "treat as number" effect of ++ initializes the element to 0.

Next, the current value is tested for truthiness, and if is true, the remainder of the loop is skipped via next. This means that the remainder of the loop will be executed only the first time this hash element is seen.

Lastly, the hash element is incremented. This will keep the remainder of the loop from being executed for this hash key ever again.
print OUTPUT_FILE join( "\t", @row ), "\n";
Finally, print out a line for this row. So, in effect, only print out this exact list of data the first time it's encountered in the query results.

We're building the house of the future together.