my @actualData; my @expectedData; # $actualFile and $expectedFile are the names of the files # that will be diff'ed. # At this point they are unmodified copies of the files I # want to manipulate and then compare tie (@actualData, tie::File, $actualFile, mode => O_RDWR, autodefer => 0); tie (@expectedData, tie::File, $expectedFile, mode => O_RDWR, autodefer => 0); # Here would do lots of stuff with @actualData # and @expectedData untie @actualData; untie @expectedData; # ...and here would do the file comparison of $actualFile and $expectedFile