Development Perl Question

Discussion in 'Software' started by woodshop, 26 Nov 2004.

  1. woodshop

    woodshop UnSeenly

    Joined:
    14 Oct 2003
    Posts:
    1,408
    Likes Received:
    8
    I got a perl script thing

    In it i want to run an external app.

    To my knowlage that leaves me with eather
    System()
    or
    exec()

    But neater will do what i want.
    I want to run the external app.
    but then just forget that i did it so that the script continues on and eventually ends but leaves the process that it started still runnig.

    How can I do this if i even can
     
  2. ST8

    ST8 What's a Dremel?

    Joined:
    14 Feb 2003
    Posts:
    596
    Likes Received:
    0
    `/path/to/prog & >/dev/null &`

    will start a process and send it into the background...

    can grab results using

    $var = `/path/to/prog & >/dev/null &`;

    back tics do the same thing as exec
     
  3. woodshop

    woodshop UnSeenly

    Joined:
    14 Oct 2003
    Posts:
    1,408
    Likes Received:
    8
    Ok then your $var = .....
    raises another question then.
    should i do that would the script still continue on and eventually exit when it reaches the end of the SCRIPT.

    If so then what would be the point of storing the output in $var.
    is it possable to retreve the $var info upon reexecutition of the script?

    O and your trick thing DID work with out the $var part.
    I havent tried it with the $var
     
  4. ST8

    ST8 What's a Dremel?

    Joined:
    14 Feb 2003
    Posts:
    596
    Likes Received:
    0
    the $var part just captures standard output, here you are routing that to /dev/null so you wont get anything. If you want to read it back later route output to a file then read that.

    `/path/to/prog & >/test.txt &`

    then read test.txt later...
     

Share This Page