Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: die through several evals

by kennethk (Abbot)
on Apr 24, 2013 at 17:59 UTC ( #1030469=note: print w/replies, xml ) Need Help??


in reply to Re^2: die through several evals
in thread die through several evals

What sort of tasks/side effects are happening in the subroutines? You may be able to solve your issue with a fork, a la:
use strict; use warnings; if (my $pid = fork) { eval { local $SIG{ALRM} = sub{die "Timeout hit\n"}; alarm 1; wait; alarm 0; 1; } or do { print $@; kill 9, $pid; } } else { magick_die(); exit; } sub magick_die { my $var = 0; for (1 ... 1000000) { $var++ for 1 .. 1000000; } }

If you need to pass information back and forth, you could serialize over pipes.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030469]
help
Chatterbox?
[LanX]: ... test
[LanX]: ...
[sierpinski]: test passed?
[sierpinski]: It's really weird seeing that I have 20 votes now.. I've been at 18 for so long
[LanX]: yes, test passed :)
[sierpinski]: woo hoo! you can go home for the day now

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2017-03-28 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (331 votes). Check out past polls.