in reply to Re^2: How use $^M?
in thread How use $^M?

Honestly I don't know how to simulate "running out of memory" for experimenting

That is one of those things that seems like it should be quite easy...that is, until you start to think about actually doing it!
If I were going to try, I think I would start with a virtual machine with very little memory allocated and then get my program to deliberately create lots of arrays of arrays.