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

Re: The coderef in @INC strikes back

Thread Previous | Thread Next
Jonathan Stowe
August 22, 2001 01:05
Re: The coderef in @INC strikes back
Message ID:
On Tue, 21 Aug 2001, Rafael Garcia-Suarez wrote:

> Do you remember this little odd feature that allows to add
> a coderef in @INC? See the digest for info :
> AFAIK, this feature has been left unfinished in the core :
> there are no docs and no tests for it.

So I sat down with my computer with a view to seeing what I could do about
this and whilst writing a test to determine what use could be made of the
coderef that is passed to the subroutine I  came up with :

#!/usr/bin/perl -w

use strict;

   push @INC , bless( sub { print "*@_*" }, 'Foo');

use Foggle;

Which to my surprise gives :

Can't locate object method "INC" via package "Foo" (perhaps you forgot to
load "Foo"?) at line 10.
BEGIN failed--compilation aborted at line 10.

Now maybe I shouldnt be surprised and maybe I have missed something here
but to me this looks like it wants me to define Foo::INC() - but even
doing that doesnt help.

A cursory examination of the code of pp_require() seems to suggest that it
should work - is this just not finished ?

Jonathan Stowe                      |
<>          |      This space for rent

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About