I would like to time few perl statements and then re-run them if they exceed a fixed amount of time.
eg.
{
foreach $var(@somearray)
{
print $var;
}
}
What i want to do is time this block and if this block exceeds more than say 10 minutes to run, I want to come out of the block and do something else. ( For this block you can keep a statement inside to check, but generically I want to do it for any block not just this one).
Is there a way I can do this in perl without using threads or forks ?
Thanks.....
eg.
{
foreach $var(@somearray)
{
print $var;
}
}
What i want to do is time this block and if this block exceeds more than say 10 minutes to run, I want to come out of the block and do something else. ( For this block you can keep a statement inside to check, but generically I want to do it for any block not just this one).
Is there a way I can do this in perl without using threads or forks ?
Thanks.....