in reply to XML Tags Stripping & Calculating checksum on it

I suggest to stronger interleave reading and writing of whole (processed) records or lines keeping $tempContent short. Try to calculate the CRC incrementally. E.g. String::CRC32 or pack could be helpful here. The last chunk to contribute to the CRC will be the trailing "\n".
  • Comment on Re: XML Tags Stripping & Calculating checksum on it