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; } };
In reply to Re^3: Cancel/no-op a require
by sedusedan
in thread Cancel/no-op a require
by sedusedan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |