<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=584235623-09082006><FONT face="Courier New"
color=#0000ff size=2>Wow! Excellent ideas on both (alarm and fork).
I will look into them. Thanks for your input.</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><FONT face="Courier New" size=2>Peter</FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com@pm.org
[mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com@pm.org] <B>On
Behalf Of </B>Garth Webb<BR><B>Sent:</B> Wednesday, August 09, 2006 4:31
PM<BR><B>To:</B> San Francisco Perl Mongers User Group<BR><B>Cc:</B>
sfpug@sf.pm.org<BR><B>Subject:</B> Re: [sf-perl] How to monitor a spawned
sub-process<BR></FONT><BR></DIV>
<DIV></DIV>It sounds like you want to set an alarm. See "perldoc -f alarm"
for more details.<BR><BR>Garth<BR><BR>
<DIV><SPAN class=gmail_quote>On 8/9/06, <B class=gmail_sendername>Loo, Peter #
PHX</B> <<A href="mailto:Peter.Loo@source.wolterskluwer.com">
Peter.Loo@source.wolterskluwer.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><SPAN><FONT face="Courier New" size=2>Hi All,</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Courier New" size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face="Courier New" size=2>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:</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Courier New" size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face="Courier New" size=2>eval {</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Courier New" size=2> $dbh->do("insert into
table1 select a.col1, a.col2, b.col4 from table1 a, table2
b");</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Courier New" size=2> };</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Courier New" size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face="Courier New" size=2>So if the above process does not
complete after 10 minutes, I was to quit out of the
program.</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Courier New" size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face="Courier New" size=2>Hope this information is
clear.</FONT></SPAN></DIV>
<DIV align=left><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><FONT face="Courier New"
size=2>Peter</FONT></DIV></DIV></DIV><BR>_______________________________________________<BR>SanFrancisco-pm
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm"
target=_blank>http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</A><BR><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>