develooper Front page | perl.perl5.porters | Postings from June 2008

[perl #55570] [PATCH] vivify error filehandle

Thread Next
From:
=?ISO-8859-1?Q?Ren=E9e_B=E4cker?=
Date:
June 11, 2008 03:24
Subject:
[perl #55570] [PATCH] vivify error filehandle
Message ID:
484FA7C3.3060402@smart-websolutions.de
This is a small patch that solves the problem:


rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ ./perl -Ilib 
../bugs/open.pl
test at /home/rbaecker/perl510/bugs/test.pl line 6.
rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ cd ../test/perl-5.10.0
rbaecker@www-devel-rbaecker ~/perl510/test/perl-5.10.0 $ ./perl -Ilib 
../../bugs/open.pl
Use of uninitialized value $err in <HANDLE> at ../../bugs/open.pl line 11.
readline() on unopened filehandle at ../../bugs/open.pl line 11.
rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ cat ../bugs/open.pl
#!/usr/bin/perl

use strict;
use warnings;
use IPC::Open3;

my ($wtr,$rdr,$err);

my $pid = open3($wtr,$rdr,$err,'perl /home/rbaecker/perl510/bugs/test.pl');

print <$err>;

rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ cat ../bugs/test.pl
#!/usr/bin/perl

use strict;
use warnings;

warn "test";

rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $


Another related bug report is #31738 
(http://rt.perl.org/rt3/Ticket/Display.html?id=31738)

-- 
Renée Bäcker
renee.baecker@smart-websolutions.de

XING: http://www.xing.com/profile/Renee_Baecker
Foo-Magazin: http://foo-magazin.de


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About