I received a (welcome) off-list reply to my report of 
trouble running CygWin Perl and piping the output of
an open FILEHANDLE call to capture the output.

Interesting his reproduction of the problem uses other
programs so it is NOT just netsh (although these could
conceivably be unrelated it seems doubtful).

(FYI:  I am avoiding the problem by redirecting the output
to a temporary file then reading in the results -- obviously
not as clean a solution:
  my $ipsec = '/tmp/ipsxxxx.txt';
  system "netsh ipsec static show all format=table >$ipsec";
  open IPSEC, "<$ipsec" or die "Cannot open $ipsec: $!\n";
)

The offlist message is attached inline (with permission) here:


From: Jerome Zago [mailto:] 
Sent: Monday, August 15, 2005 11:06 AM
To: Herb Martin
Subject: RE: Cygwin perl hangs with open FH, "... |"

Hi, I can reproduce this problem, and this used to work before as well.

Cygwin, GNU bash, Perl: same versions.
ccm: 6.3 SP4
ruby: 1.8.2 [i386-mswin32]

[EMAIL PROTECTED] ccm rt -show info 'COM9:Insulated Development' | wc
     13      48     481

[EMAIL PROTECTED] perl -e "open FH, 'ccm rt -show info \'COM9:Insulated
Development\' |'; print while <FH>" | wc
     13      48     481

[EMAIL PROTECTED] ccm rt -list | wc
    631    1896   37229

[EMAIL PROTECTED] perl -e "open FH, 'ccm rt -list |'; print while <FH>" | wc
[hangs]

[EMAIL PROTECTED] perl -e "open FH, 'ruby -e \'system \"ccm rt -list\"\' |'; 
print
while <FH>" | wc
    631    1896   37229

I don't get it... Note that ccm and ruby are both native binaries.

Feel free to forward this message to the mailing-list (I'm not subscribed).



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to