develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [PATCH] put useful info in %INC for files loaded by a hook in @INC

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
August 28, 2001 05:38
Subject:
Re: [PATCH] put useful info in %INC for files loaded by a hook in @INC
Message ID:
20010828144404.A19499@rafael

On 2001.08.28 14:24:13 +0200 Arthur Bergman wrote:
> 01-08-28 14.23, skrev Rafael Garcia-Suarez på rgarciasuarez@free.fr
> följande:
> 
> > I also briefly documented this in perlvar/%INC.
> > 
> > I'll add tests for this, but the fact that the tests do not run
> > on perl+stdio annoys me. (Simply returning *DATA from the hook may be
> > a solution.)
> 
> Thanks applied, is the reference correct for objects or only for coderefs?

Objects, coderefs and arrayrefs.

> Why doesn't *DATA work in stdio?

Sorry, I've not been clear. The current tests (t/op/inccode.t) don't work
with stdio, only with perlio, because of the idiom:
	open $fh, '<', \$scalar
used to construct the filehandle to be returned from the subroutine put in
@INC.

If I return *DATA instead of $fh, I think that the tests will work with
stdio. Problem : this will imply to use seek() on the DATA filehandle
and to delete the key 'Foo.pm' from %INC after each test.

-- 
Rafael Garcia-Suarez

Thread Previous | 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