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 (Canon) 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.