Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^3: Cancel/no-op a require

by sedusedan (Monk)
on Dec 07, 2012 at 14:06 UTC ( #1007743=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Cancel/no-op a require
in thread Cancel/no-op a require

OK, so now the correct incantation should be:

unshift @INC, sub { my ($self, $name) = @_; # load the module first local @INC = grep { !ref($_) || $_ != $self } @INC; require $name; # add logging to the package # ignore this hook my $line = 0; return sub { unless ($line++) { $_ = "1;\n"; return 1; } return 0; } };

Comment on Re^3: Cancel/no-op a require
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007743]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2015-11-30 13:34 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (770 votes), past polls