use POSIX ":sys_wait_h"; # e.g.: my ($pid, $listing) = pidqx( "ls" ); sub pidqx { # returns pid + the usual backtick result my $pid = open my $ph, "$_[0] |" or die "$!: $_[0]"; local $/ = undef(); my $backtick = <$ph>; close $ph; waitpid $pid, 0; return ( $pid, $backtick ); }
-M
Free your mind
In reply to Re: Process ID of qx
by Moron
in thread Process ID of qx
by ropey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |