Can perl start another perl script and then exit?

Discussion in 'Perl Misc' started by Bill H, Sep 17, 2007.

  1. Bill H

    Bill H Guest

    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
     
    Bill H, Sep 17, 2007
    #1
    1. Advertising

  2. On Sep 17, 3:44 pm, Bill H <> 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.
     
    Mahesh Asolkar, Sep 18, 2007
    #2
    1. Advertising

  3. Bill H

    Ben Morrow Guest

    Quoth 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.


    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
     
    Ben Morrow, Sep 18, 2007
    #3
  4. Bill H

    Bill H Guest

    On Sep 17, 8:03 pm, Mahesh Asolkar <> wrote:
    > On Sep 17, 3:44 pm, Bill H <> 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
     
    Bill H, Sep 18, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FuZHk=?=

    Code to Exit Web App and Exit Internet Explorer

    =?Utf-8?B?U2FuZHk=?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    7,907
    =?Utf-8?B?U2FuZHk=?=
    Aug 5, 2005
  2. Yujo
    Replies:
    2
    Views:
    408
    Gabriel Genellina
    Apr 10, 2007
  3. Replies:
    0
    Views:
    298
  4. kaleem
    Replies:
    8
    Views:
    822
    Tad McClellan
    Dec 14, 2006
  5. Replies:
    4
    Views:
    546
    cwdjrxyz
    Jan 17, 2006
Loading...

Share This Page