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

The coderef in @INC strikes back

Thread Next
From:
Rafael Garcia-Suarez
Date:
August 21, 2001 12:52
Subject:
The coderef in @INC strikes back
Message ID:
20010821215400.A690@rafael
Do you remember this little odd feature that allows to add
a coderef in @INC? See the digest for info :

http://www.perl.com/pub/a/2001/03/p5pdigest/THISWEEK-20010305.html#Coderef_INC

AFAIK, this feature has been left unfinished in the core :
there are no docs and no tests for it.

I've looked back into the p5p archives. You can add a coderef in @INC;
it should return a filehandle from which the Perl source to use/require
will be read. An arrayref in which the 1st element is a coderef will
also work.

The thing becomes more complicated when you learn that this coderef is
also allowed to return _another_ coderef (in addition to the filehandle)
that will act as a source filter. (I'm summarizing the API here, but
that's the big picture). Doesn't this duplicate the functionality
provided by the Filter::* modules? (TIMTOWTDI, but that's not a reason
to include in the core something that is also provided by separate
modules).

Anyway, documentation and tests are needed here. Also, I think that
the core modules that iterate over @INC, assuming that it contains
strings, should be reviewed.

Any hints or comments?

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