in reply to compare two data sets (matrix)

In addition to the previous excellent hints given so far I'd like to recommend perllol, which describes arrays of array references in depth.