in reply to ActiveState woes : Is it EOF-blind?

You actually have two problems in there. The first is Suffering from Buffering. The second is in trying to evoke the perl interpreter and expect it to pass your filehandles to it's child ( I tried to puzzle out what actually happens to STDIO during this but that just made my head hurt.) IPC::Open2 has a good suggestion:

"The big problem with this approach is that if you don't have control over source code being run in the child process, you can't control what it does with pipe buffering. Thus you can't just open a pipe to "cat -v" and continually read and write a line from it." "The IO::Pty and Expect modules from CPAN can help with this, as they provide a real tty (well, a pseudo-tty, actually), which gets you back to line buffering in the invoked command again."


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}
  • Comment on Re: ActiveState woes : Is it EOF-blind?

Replies are listed 'Best First'.
Re^2: ActiveState woes : Is it EOF-blind?
by ikegami (Patriarch) on May 05, 2008 at 23:08 UTC
    The second problem you mention ("The second is in trying to evoke the perl interpreter and expect it to pass your filehandles to it's child") makes no sense to me: The launched perl doesn't have a child. Could you explain?

      ikegami writes:

      The launched perl doesn't have a child. Could you explain?
      Yes, I misspoke, must have been temporarily missing all clue. Had been working on calling the shell from qx() and was lost in an incorrect mind set. Of course what ikegami is talking about is that perl is interpreting the users cat.pl script and not forking a child . Further discussion here has clarified ( somewhat ) that the problem lies in another direction.


      s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}
Re^2: ActiveState woes : Is it EOF-blind?
by almut (Canon) on May 05, 2008 at 22:58 UTC
    "The IO::Pty and Expect modules from CPAN can help with this, ...

    Unfortunately, those modules don't work on native Windows...