[29079] in Perl-Users-Digest
Perl-Users Digest, Issue: 323 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 11 16:09:55 2007
Date: Wed, 11 Apr 2007 13:09:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 11 Apr 2007 Volume: 11 Number: 323
Today's topics:
Asynchronous perl execution andrewjones86@googlemail.com
Re: Asynchronous perl execution <jurgenex@hotmail.com>
Re: Asynchronous perl execution xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Apr 2007 07:43:54 -0700
From: andrewjones86@googlemail.com
Subject: Asynchronous perl execution
Message-Id: <1176302634.193907.54500@n76g2000hsh.googlegroups.com>
Hi,
I have a Perl CGI script which when ran needs to search through a lot
of text files and remove strings. What I would like to do is have this
sub routine running as a child on its own, while the parent goes and
loads the webpage. I don't want the parent to have to wait for the
child to finish, or its not really asynchronous.
I have looked into fork(), but its not easy to understand and when I
tried more than a basic example I ran into problems.
Any pointers in the right direction would be very much appreciated.
Thanks,
Andrew
------------------------------
Date: Wed, 11 Apr 2007 15:15:20 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Asynchronous perl execution
Message-Id: <cY6Th.14809$Cl.8674@trndny08>
andrewjones86@googlemail.com wrote:
> I have a Perl CGI script which when ran needs to search through a lot
> of text files and remove strings. What I would like to do is have this
> sub routine running as a child on its own, while the parent goes and
> loads the webpage. I don't want the parent to have to wait for the
> child to finish, or its not really asynchronous.
>
> I have looked into fork(),
Yes, that is the best approach. Another possibility would be to use system()
or qx() to start a new process and mark the call in such a way that the
OS/system shell will start the process in the background.
> but its not easy to understand and when I
> tried more than a basic example I ran into problems.
> Any pointers in the right direction would be very much appreciated.
Might have helped if you explained what those problems were and showed some
actual sample code that created those problems.
jue
------------------------------
Date: 11 Apr 2007 16:05:57 GMT
From: xhoster@gmail.com
Subject: Re: Asynchronous perl execution
Message-Id: <20070411120559.171$fe@newsreader.com>
andrewjones86@googlemail.com wrote:
> Hi,
>
> I have a Perl CGI script which when ran needs to search through a lot
> of text files and remove strings. What I would like to do is have this
> sub routine running as a child on its own, while the parent goes and
> loads the webpage. I don't want the parent to have to wait for the
> child to finish, or its not really asynchronous.
>
> I have looked into fork(), but its not easy to understand and when I
> tried more than a basic example I ran into problems.
What problems? It is hard to solve problems without knowing what they are.
> Any pointers in the right direction would be very much appreciated.
Your child process should probably close or re-open STDIN, STDOUT, and
STDERR. And you should follow the posting guidelines.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 323
**************************************