[sf-perl] How to monitor a spawned sub-process

Loo, Peter # PHX Peter.Loo at source.wolterskluwer.com
Wed Aug 9 16:57:42 PDT 2006

Wow!  Excellent ideas on both (alarm and fork).  I will look into them.
Thanks for your input.


From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org
[mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or
g] On Behalf Of Garth Webb
Sent: Wednesday, August 09, 2006 4:31 PM
To: San Francisco Perl Mongers User Group
Cc: sfpug at sf.pm.org
Subject: Re: [sf-perl] How to monitor a spawned sub-process

It sounds like you want to set an alarm.  See "perldoc -f alarm" for
more details.


On 8/9/06, Loo, Peter # PHX < Peter.Loo at source.wolterskluwer.com
<mailto:Peter.Loo at source.wolterskluwer.com> > wrote: 

	Hi All,
	I was wondering if there is a good way to monitor a spawned
process within a Perl program.  For example: I am using Perl DBI to run
a SQL command.  However, I would like to give the SQL process some time
to complete and at some point break out and quit if a set time has been
exceeded.  Code example:
	eval {
	  $dbh->do("insert into table1 select a.col1, a.col2, b.col4
from table1 a, table2 b");
	So if the above process does not complete after 10 minutes, I
was to quit out of the program.
	Hope this information is clear.

	SanFrancisco-pm mailing list
	SanFrancisco-pm at pm.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20060809/18305afa/attachment-0003.html 

More information about the SanFrancisco-pm mailing list