in reply to Reaped: Re^4: Problem with Tie::File
in thread Problem with Tie::File

That chunk of code is useless to us. (What's tie::File? Where's O_RDWR defined? Are $actualFile and $expectedFile file names or file handles? Did you use use strict; use warnings; or not?) This is neither your program with the irrelevant processing removed, nor does it demonstrate the problem. And what's with not checking for errors even when you know you're having a problem.