Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Wednesday September 27, 2006
09:44 AM

Coderefs in @INC

[ #31136 ]

I needed to find out just what was loading a module and the order things were loaded in. I seemed to recall a module which would do that,but I couldn't remember it (short of breaking out Devel::Trace). Then I remembered I could just shove a coderef in @INC and be done with it:

use Carp 'cluck';

BEGIN {
    unshift @INC => sub {
        my ( $coderef, $filename ) = @_;
        cluck("Found the culprit!") if $filename eq 'Path/To/Your/Module.pm';
    };
}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.