in reply to Re: Issue with communication of large data between Parent and child using Perl pipes
in thread Issue with communication of large data between Parent and child using Perl pipes

I looked for that the "-" modifier does in front of pipe symbol,

It's the 3-arg form of "command|"

open(my $pipe, "$command |") # 2-arg form open(my $pipe, '-|', $command) # 3-arg form

"open()" does NOT return a PID

Actually, it does when using open to create a process and pipe. This is documented.

And it appears that -| and |- without further arguments simply forks without executing anything instead of giving an error or trying to launch a program named "-". This doesn't seem to be documented. [ Apparently it is, just not in open. See reply ]

  • Comment on Re^2: Issue with communication of large data between Parent and child using Perl pipes
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: Issue with communication of large data between Parent and child using Perl pipes
by ig (Vicar) on Jul 17, 2009 at 21:52 UTC
    This doesn't seem to be documented.

    It's documented in Safe Pipe Opens, with examples that might be helpful to the OP.

Re^3: Issue with communication of large data between Parent and child using Perl pipes
by Marshall (Canon) on Jul 17, 2009 at 22:04 UTC
    Thanks! ikegami!

    open(my $pipe, "$command |") # 2-arg form open(my $pipe, '-|', $command) # 3-arg form
    above looks right, this 2 arg form from OP looked weird to me:
    $pid=open(PARENT_READ_HANDLE, "-|");
    Which as they say is neither fish or fowl (not correct 2-arg or 3 arg). I am still a bit confused as to the OP's intent here. This still appears to be a synchronous app, not client-server. There is a lot of complex stuff that doesn't appear to be necessary.