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

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

Thread Previous | Thread Next
From:
Simon Cozens
Date:
September 4, 2001 00:47
Subject:
Re: [PATCH] put useful info in %INC for files loaded by a hook in @INC
Message ID:
20010903223136.A623@netthink.co.uk
On Wed, Aug 29, 2001 at 11:23:53PM +0100, Nicholas Clark wrote:
> Although as 0x81095c8 corresponds to the address in @INC, there's nothing
> stopping the &(0x81095c8) stripper actually extracting the 0x81095c8 from
> it, and walking @INC to find a reference with that address. And if it finds
> one calling that reference.
> 
> [Not quite sure what to do if it does not. Presumably this corresponds to
> @INC being modified between initial loading and later loading.

Or someone's being naughty. We're rapidly approaching easily-hackable
territory here:

    sub Foo::Bar {
        $me = \&Foo::Bar; $me=~s/CODE/&/;
        require "$me/what/does/this/do?";
    }
    push @INC, \&Foo::Bar;

On second thoughts, this might be considered a feature...

Simon

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