in reply to Executing a process in the background AND getting its pid
One of the following "forking opens" might suit your needs
my $pid = open my $fhOut, "| the command ", or die ...; ## or my $pid = open my $fhIn, "the command |", or die ...; ## or using the 3-arg form on *nix systems my $pid = open my $fhOut, '|-', "the command ", or die ...; ## or my $pid = open my $fhIn, '-|', "the command", or die ...;
Or list forms of the latter two, if you need to pass arguments, may make sense on your system.
See open and perlopentut for more information.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Executing a process in the background AND getting its pid
by henrikbe (Novice) on Jun 12, 2007 at 08:05 UTC | |
|
Re^2: Executing a process in the background AND getting its pid
by Anonymous Monk on Jun 12, 2012 at 17:54 UTC | |
by BrowserUk (Patriarch) on Jun 12, 2012 at 18:07 UTC |