This is NOT a file format that corrupts itself. This is a file reader that corrupts files. There's a big difference. Nothing about the format itself causes or requires corruption. A better tagline would be "decayfmt is a social contract enforced by pinky promise".
Tie::Hash::Cannabinol is a completely useless demonstration of how to use Tie::StdHash to
pervert the behaviour of Perl hashes. Once a hash has been tied to Tie::Hash::Cannabinol,
there is a 25% chance that it will forget anything that you tell it immediately and a
further 25% chance that it won't be able to retrieve any information you ask it for. Any
information that it does return will be pulled at random from its keys.
Oh, and the return value from exists isn't to be trusted either :)
Seems like there is no mechanism to allow non-corrupting reads from authorized processes? Begs the question then of what the point of this is. Pure novelty, or truly something that could be used in practice?
A better analogy would be if every time you played the video file, the mechanism hallucinated a little, bringing in your current feelings as input to change the emotional undertones (and possibly characters and events) depicted in the video.
A company I was at had a disk array that would do something like this. It wasn't a documented feature mind you. During writes, it would randomly zero out data within a file. So at least it didn't get progressively worse, but it was a bear to isolate. These were large media files so a quick look at the head/middle/tail could easily miss the problem areas.
What's the other side of the contract? Why would a reader oblige to corrupt?