Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How do you get the PID of an external process?

by McA (Priest)
on Sep 24, 2013 at 23:21 UTC ( #1055561=note: print w/ replies, xml ) Need Help??


in reply to How do you get the PID of an external process?

Hi,

you say, that the forked childs use $pid = system(1,"start $executable $args") to start "a program". That would mean that the program you call has the name 1. Is that true?

And looking at the documentation of system shows that the returned value is NOT the pid. So, please show us a little example.

Regards
McA

Replies are listed 'Best First'.
Re^2: How do you get the PID of an external process?
by salva (Abbot) on Sep 25, 2013 at 06:41 UTC
    system(1, $cmd) is a special case. IIRC, a hack provided on the port of Perl for Windows to support IPC::Open3 there.

    It just launches the given command on the background.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055561]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2016-07-29 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (264 votes). Check out past polls.