Interesting technique. In Data::Compare I use something very different - I just keep a hash whose keys are stringified representations of everywhere that I have been. Your method wins if you have huge amounts of data, and I might adopt it myself, but I'd be worried that it would break:
if the code was moved from a 32-bit to a 64-bit machine
on different versions of perl, especially 5.0 vs 5.8