Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear all wise Monks of the Perl Code,
i have a question that is disturbing my inner confidence. I want to eval a piece of code. So with an eval I can make sure that an error in the code dont let me script die. But what if the code enter an infinite loop? Is there any way (except modifying the code that is evaled) to stop it My script so far:
Now I want to give the text to be evaled a certain time to execute and break it of if it not ended after this time. Because the code can be anything (contains maybe an infinite loop or something else that can hang). I cant run it as a separate process, because it needs the context of my script. Anyone have any idea ? Bless Perl and all other things that are good and righteous, Andre In reply to Stopping code in eval by Outaspace
|
|