Oh, in that case just compare the outputs with the cmp program if the outputs are written to files (eg. system("diff", "-s", "--", $filename1, $filename2) returns true if the files are different).
If you're sure you want the outputs in arrays, compare them with like join("", @output1) eq join("", @output2) if the lines in the arrays still have the trailing newlines or pack("(J/a)*", @output1) eq pack("(J/a)*", @output2) if you're not sure what the delimiters are or @output1 == @output2 and !grep { $output1[$_] ne $output2[$_] } 0 .. @output1 - 1 if you don't want to waste memory.