Skip Menu |

This queue is for tickets about the SelfLoader CPAN distribution.

Report information
The Basics
Id: 32383
Status: resolved
Priority: 0/
Queue: SelfLoader

People
Owner: Nobody in particular
Requestors: jdhedden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.14
Fixed in: (no value)



Subject: Reading from close filehandle in test
'make test' produces the following: /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00pod...................ok t/01SelfLoader............readline() on closed filehandle DATA at t/01SelfLoader.t line 181. ok t/02SelfLoader-buggy......ok All tests successful. Files=3, Tests=22, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.34 cusr 0.11 csys = 0.48 CPU) Result: PASS However, when I run: perl -Mblib t/01_SelfLoader.t that warning does not appear. This occurs with both 5.8.8 maint and 5.10.0. The attached patch seems to correct this problem.
Subject: sl.patch
--- t/01SelfLoader.t.orig 2008-01-17 09:04:35.532501800 -0500 +++ t/01SelfLoader.t 2008-01-17 09:04:41.798848600 -0500 @@ -178,12 +178,15 @@ } # Try to read from the data file handle -my $foodata = <Foo::DATA>; -close Foo::DATA; -if (defined $foodata) { - print "not ok 18 # $foodata\n"; -} else { - print "ok 18\n"; +{ + $SIG{__WARN__} = sub { my $warn = shift; }; + my $foodata = <Foo::DATA>; + close Foo::DATA; + if (defined $foodata) { + print "not ok 18 # $foodata\n"; + } else { + print "ok 18\n"; + } } # Check that __END__ DATA is honoured
Subject: Re: [rt.cpan.org #32383] Reading from close filehandle in test
Date: Thu, 17 Jan 2008 15:54:30 +0100
To: bug-SelfLoader [...] rt.cpan.org
From: Steffen Mueller <l2ot9pa02 [...] sneakemail.com>
Hi Jerry, Jerry D. Hedden via RT wrote: [...] Show quoted text
> t/01SelfLoader............readline() on closed filehandle DATA at
[...] Show quoted text
> This occurs with both 5.8.8 maint and 5.10.0. > > The attached patch seems to correct this problem.
Thanks! I've seen this but forgot to act upon it. I'll apply your patch and make a release soon. Best regards, Steffen
Applied in 1.15 on CPAN.