$cmd="$scriptsdir/process_tar.pl $file >> /tmp/testlog &"; + $pid=open(PID,"|$cmd"); #### #!/usr/bin/perl # file pid.pl sleep 1; print "$0 PID: $$\n"; #### #!/usr/bin/perl my $cmd = 'echo my PID is $$ && ./pid.pl'; my $pid = open PID, "| $cmd" or die "Can't run ./pid.pl: $!\n"; print "PID returned by open: $pid\n"; sleep 2; __END__ my PID is 4465 PID returned by open: 4465 ./pid.pl PID : 4466