# compare each row in the first set of data to every row # in the second set of data. If it does not occur, then # they are different, so print. for my $a ( @ds1_rows ) { my $record1 = "@$a"; my $bool = ''; for $aref ( @ds2_rows ) { my $record2 = "@$a"; $found = $record1 eq $record2; $bool = $found; # set bool variable to value of found last if $found; } # if the boolean variable is equal to nothing, the for loop was # not exited prematurely, thus no record was found matching. if ($bool eq '') { $record_count++; } } # assign field names to values for each record that # is found to be different for (my $x = 0; $x < $record_count; $x++) { for (my $y = 0; $y < $field_count; $y++) { print $column_names[$y] . ": " . $ds1_rows[$x][$y] . "\n" unless $found; } }