http://www.perlmonks.org?node_id=562489


in reply to Stopping code in eval

Besides infinite loops, I presume that you also worry about memory allocations, and in general, allocation of resources. You need BSD::Resource to impose resource limits. (Depending on your operating system, you can limit consumption of some resources.)