Package: perl-base
Version: 5.8.8-11.1
Severity: normal

IPC::Open3 states (right in the synopsis!) that I can do this:

  my($wtr, $rdr, $err);
  $pid = open3($wtr, $rdr, $err, 'some cmd and args', 'optarg', ...);

But this doesn't actually work; STDOUT and STDERR go to $rdr and $err is
left uninitialized.  Apparently this is because $err is uninitialized,
and the doc says:

 If CHLD_ERR is false, or the same file
        descriptor as CHLD_OUT, then STDOUT and STDERR of the child are
        on the same filehandle.

But then the example is incorrect, and I'd suggest that the doc
specifically mention that $err must be true, since the above invocation
is common and works for the other open calls.

Enclosed is a little program that illustrates the problem; invoke it and
pass it some command that writes to STDOUT and STDERR (one is enclosed
for your convenience).

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-lizzie
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages perl-base depends on:
ii  libc6                         2.6.1-6    GNU C Library: Shared libraries

perl-base recommends no packages.

-- no debconf information

*** /home/yitzhak/perl/open3-test.pl
#! /usr/bin/perl -w

#usage: 'open3-test.pl a-command-that-prints-to-STDOUT-and-STDERR

use IPC::Open3;

my($wtr, $rdr, $err, $pid);
#$err = 'something';
$pid = open3($wtr, $rdr, $err, $ARGV[0]);
#print "\$err is $err\n";
print "Here's STDOUT:\n";
while (<$rdr>) {print "\t$_"}
print "Here's STDERR:\n";
while (<$err>) {print "\t$_"}

*** /home/yitzhak/perl/out-and-err.pl
#! /usr/bin/perl -w

print "This is STDOUT\n";
print STDERR "This is STDERR\n";



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to