Greetings,

I was trying to use IPC::Open3 in a Windows 7 but I was getting the complaint below:

readline() on unopened filehandle

I found it intriguing since if I use the same program to fork a child process with IPC::Open2 it works as expected. Seems to be that STDERR is not being assigned as it would be expected.

To be sure, I wrote the two following scripts for testing:

use warnings; use strict; use feature 'say'; say 'foobar'; warn 'this is a warning';

And called it "dummy.pl".

Then I wrote:

use warnings; use strict; use IPC::Open3; use feature qw(say); my ( $wtr, $rdr, $err ); my $pid = open3( $wtr, $rdr, $err, 'perl', 'dummy.pl' ); while (<$rdr>) { print $_; } while (<$err>) { print $_; } close($err); close($rdr); close($wtr); waitpid( $pid, 0 );

After executing it, this is what I got:

c:\Temp>teste.pl this is a warning at dummy.pl line 7. foobar Use of uninitialized value $err in <HANDLE> at C:\Temp\teste.pl line 1 +5. readline() on unopened filehandle at C:\Temp\teste.pl line 15.

It looks like a bug, doesn't it?

I'm using Windows 7 Service Pack 1 with:

This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x +86-multi-thread
Alceu Rodrigues de Freitas Junior
---------------------------------
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

In reply to Is there a problem with IPC::Open on Windows 7? by glasswalk3r

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.