Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Can perl start another perl script and then exit?

Reply
Thread Tools

Can perl start another perl script and then exit?

 
 
Bill H
Guest
Posts: n/a
 
      09-17-2007
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

 
Reply With Quote
 
 
 
 
Mahesh Asolkar
Guest
Posts: n/a
 
      09-18-2007
On Sep 17, 3:44 pm, Bill H <(E-Mail Removed)> wrote:
> 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.

 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      09-18-2007

Quoth Bill H <(E-Mail Removed)>:
> 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

 
Reply With Quote
 
Bill H
Guest
Posts: n/a
 
      09-18-2007
On Sep 17, 8:03 pm, Mahesh Asolkar <(E-Mail Removed)> wrote:
> On Sep 17, 3:44 pm, Bill H <(E-Mail Removed)> wrote:
>
>
>
>
>
> > 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.- Hide quoted text -
>
> - Show quoted text -


Thanks for the tip Mahesh. Will look into threads.

BIll H

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My mouse Hangs when I start my computer and then start Firefox booddhhoo Computer Support 3 03-12-2006 05:38 PM
How does one play a .wav file and then another and then another...? ted.j.conway@gmail.com Javascript 4 01-17-2006 03:28 AM
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM
Execute another perl script from my perl script Petterson Mikael Perl Misc 3 01-05-2005 01:31 PM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments