Can perl start another perl script and then exit?

B

Bill H

I need to have a perl script start another script and then exit,
returning completed header information to a web page. The other
program will continue running on the server processing some pdf files,
and when done it will set a flag.

The web page, once it initiates the 1st program (which starts the
background program) and receive the status from the 1st program (using
flash) will then start a 3rd program, which checks for the "done
flag", if it isn't set it will tell the web page (flash) to try again.
This will continue to the 2nd program is complete.

So, can I start a 2nd script in perl and have the 1st program exit
without effecting the 2nd program? System() would just wait, Exec()
would start the 2nd and leave the 1st behind.

If this is something obvious that I am missing, please point me in the
right direction.

Thanks
Bill H
 
M

Mahesh Asolkar

I need to have a perl script start another script and then exit,
returning completed header information to a web page. The other
program will continue running on the server processing some pdf files,
and when done it will set a flag.

The web page, once it initiates the 1st program (which starts the
background program) and receive the status from the 1st program (using
flash) will then start a 3rd program, which checks for the "done
flag", if it isn't set it will tell the web page (flash) to try again.
This will continue to the 2nd program is complete.

So, can I start a 2nd script in perl and have the 1st program exit
without effecting the 2nd program? System() would just wait, Exec()
would start the 2nd and leave the 1st behind.

If this is something obvious that I am missing, please point me in the
right direction.

Sounds like something threads could do. Have you tried 'perldoc
threads'?

HTH,
Mahesh.
 
B

Ben Morrow

Quoth Bill H said:
I need to have a perl script start another script and then exit,
returning completed header information to a web page. The other
program will continue running on the server processing some pdf files,
and when done it will set a flag.

The web page, once it initiates the 1st program (which starts the
background program) and receive the status from the 1st program (using
flash) will then start a 3rd program, which checks for the "done
flag", if it isn't set it will tell the web page (flash) to try again.
This will continue to the 2nd program is complete.

It is probably possible to do this without polling, which would be
easier on the network. I don't know if Flash times out HTTP requests,
but if it can be told not to one obvious way is for the third script to
simply hold off sending a reply until it is done. Of course, if you want
to do other Flash stuff simultaneously, this may not be possible unless
you can get Flash to make the request asynchronously.
So, can I start a 2nd script in perl and have the 1st program exit
without effecting the 2nd program? System() would just wait, Exec()
would start the 2nd and leave the 1st behind.

If this is something obvious that I am missing, please point me in the
right direction.

perldoc -q background

Ben
 
B

Bill H

Sounds like something threads could do. Have you tried 'perldoc
threads'?

HTH,
Mahesh.- Hide quoted text -

- Show quoted text -

Thanks for the tip Mahesh. Will look into threads.

BIll H
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top