in reply to Where's the leak?
I don't think you are seeing a _leak_ -- You seem to just be seeing perl try to be smart about memory usage. perl thinks "hey, this var needed 12 mb of space last time it was used, I will save this much memory for future usage instead of freeing it back to the system so I do not have to realocate it for this again". I bet that if you look at the size of memory the script is taking as it starts for the baseline and then run it against a 15 mb file you will see that it uses xmb more memory and holds onto it. Behind the scenes though you may notice that the memory is actually unused and swapped out (at least on unix it does this) and that only what is currently used is res.
-Waswas