Current location: Hot Scripts Forums » Programming Languages » Perl » execute a long time perl command from a cgi


execute a long time perl command from a cgi

Reply
  #1 (permalink)  
Old 03-01-04, 01:01 PM
agnosti agnosti is offline
New Member
 
Join Date: Mar 2004
Location: Athens
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
execute a long time perl command from a cgi

Hi all,

I need to execute a long time procedure from a cgi(perl) script. This isn't efficient cause I can't want for a long time for the script to end.

I tried to create a .pl script which does the whole job, so I call this script from my cgi using the system command. This, returns me a html page saying that the process started, I check in the server that the processes indeed started, but if I close the browser, the script ends abnormally.

I just need a way, to ensure that the script will be running until the end in the system, even though I close the browser window.

How can I do this?


thanks
Reply With Quote
  #2 (permalink)  
Old 03-02-04, 11:09 PM
Skeleton Man Skeleton Man is offline
Community Liaison
 
Join Date: Jun 2003
Location: Australia
Posts: 406
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

Try this:
Code:
 $cmd = 'some command'; exec($cmd);
or this:

Code:
 $cmd = 'some command'; system("$cmd &");

The first *should* execute the command and not hang around waiting for it to finish. The second runs the command in the background (using "&"), and should have the same effect.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reduce the time intensive phases of .Net application development using TierDeveloper3 smars General Advertisements 0 12-02-03 05:15 AM


All times are GMT -5. The time now is 04:57 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.