http://www.perlmonks.org?node_id=1030508


in reply to Re: CGI script calling a perl script
in thread CGI script calling a perl script

Yes myscript.pl takes a long time to run. I'm not worried about DOS because of various other security mechanisms in place. Unfortunately I don't know AJAX so I'm stuck trying to with CGI and perl. How would Proc::Daemon help in this case? Would it replace Proc::Background?

Replies are listed 'Best First'.
Re^3: CGI script calling a perl script
by mbethke (Hermit) on Apr 24, 2013 at 20:17 UTC

    Sort of, though the API is different. It helps you completely detach a process from its parent so the parent can exit while the child continues. I guess the child will write some file to the file system than and the parent somehow finds out when it's done?

    If you don't mind forcing users to enable scripting on your page, the whole AJAX stuff isn't all that difficult. Wikipedia on AJAJ has a very small example using jQuery (you could call that function that does $.getJSON in an onLoad handler or so), and the article on XMLHttpRequest has some resources on how to do it without jQuery.