CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Ending Browser Hold

 



benn600
User


Jun 15, 2005, 12:14 AM

Post #1 of 4 (641 views)
Ending Browser Hold Can't Post

When the index for my search program is being updated because a user makes a change, there is a delay. I have noticed that if I activate the update and click a link on screen while it is still showing activity, my server still has a Perl process running that finishes what it was supposed to do. Is there a way to start this process and then release browser hold? This index update can happen completely in the background.

Thanks!
----------------------------------------------------------------------------
Wink http://www.ppcpathways.com/ Wink
Visit my new site devoted to reviewing the latest pocketpc products and news that I built in cgi-perl!


davorg
Thaumaturge / Moderator

Jun 15, 2005, 5:05 AM

Post #2 of 4 (639 views)
Re: [benn600] Ending Browser Hold [In reply to] Can't Post

Use "fork" and "exec" to set the process running in the background. There are good examples of doing this kind of thing in the Perl Cookbook (which I consider an essential book for an serious Perl programmer).

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


benn600
User


Jun 15, 2005, 7:19 AM

Post #3 of 4 (637 views)
Re: [davorg] Ending Browser Hold [In reply to] Can't Post

I have been looking on the internet for the lines I need to add but am unable to find them. What should I add to get this to work? It sure would be nice! Thank you!
----------------------------------------------------------------------------
Wink http://www.ppcpathways.com/ Wink
Visit my new site devoted to reviewing the latest pocketpc products and news that I built in cgi-perl!


davorg
Thaumaturge / Moderator

Jun 15, 2005, 7:28 AM

Post #4 of 4 (636 views)
Re: [benn600] Ending Browser Hold [In reply to] Can't Post

A fork and exec looks something like this:


Code
if (fork) { 
# You're in the parent process.
# Carry on doing parent process things
} else {
# You're in the child process
# "exec" a new program which takes the place of this one
exec "path/to/your/other/program";
}


You may also need to set $SIG{CHLD} to "IGNORE" in order to avoid getting zombie processes.

Like I said, this is all explained really well in the Perl Cookbook. If you don't have a copy then you should definitely get one. In the meantime you can probably read it by signing up for the 14 day free trial of Safari.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives