Thanks for the reply, but sometimes I don't know where is the code that
cau=
se the infinite loop. Is there such as thing as perl configuration file,
to=
set the execution time for any code, any where in the program just like
ph=
p.ini file. Thanks.=0A=0A----- Original Message ----=0AFrom: Chas. Owens
<c=
has.owens@[EMAIL PROTECTED]
>=0ATo: Keenlearner <yingun@[EMAIL PROTECTED]
>=0ACc:
beginners@[EMAIL PROTECTED]
Friday, April 11, 2008 16:05:07=0ASubject: Re: Perl
maximum=
execution time=0A=0AOn Thu, Apr 10, 2008 at 9:25 PM, Keenlearner
<yingun@[EMAIL PROTECTED]
> wrote:=0A> Hello, I have had been programming in PHP for a
while,=
new to perl. I=0A> got a perl code bug where it will go to infinite
loop.=
So is there a=0A> maximum execution time that I could set in perl just
li=
ke in PHP ?=0A> Thanks=0Asnip=0A=0AYou can set an signal to go off after
X=
seconds with the alarm* function:=0A=0A#!/usr/bin/perl=0A=0Ause
strict;=0A=
use warnings;=0A=0Amy $timeout =3D 5*60; #timeout after five
minutes=0A=0Ae=
val {=0A local $SIG{ALRM} =3D sub { die "timeout\n" };=0A alarm
$time=
out;=0A #stuff you want to run in under five minutes=0A};=0Adie
unle=
ss $@[EMAIL PROTECTED]
eq "timeout\n" if $@[EMAIL PROTECTED]
=0AChas. Owens=0Awonkden.net=0AThe most im****tant skill a
prog=
rammer can have is the ability to read.=0A=0A-- =0ATo unsubscribe, e-mail:
=
beginners-unsubscribe@[EMAIL PROTECTED]
additional commands, e-mail:
beginners=
-help@[EMAIL PROTECTED]
instant
me=
ssages to your online friends
http://uk.messenger.yahoo.com=0A=0A=0A=0A=0AS=
end instant messages to your online friends http://uk.messenger.yahoo.com


|