in reply to Source filters: filter some module before including in my package

Maybe you want to see require on how to replace code before it is loaded?

  • Comment on Re: Source filters: filter some module before including in my package

Replies are listed 'Best First'.
Re^2: Source filters: filter some module before including in my package
by OlegG (Monk) on Sep 15, 2011 at 15:00 UTC
    Yeah, really forgot about require hooks. This totally solves my problem. Thanks.
Re^2: Source filters: filter some module before including in my package
by OlegG (Monk) on Sep 15, 2011 at 16:33 UTC
    Can you tell me why nothing works?
    push @INC, \&my_sub; sub my_sub { my ($self, $filename) = @_; warn $filename; } require IO::Socket;
    Expected at least output smth like: "/usr/lib/perl5/IO/Socket.pm", but get nothing. Whats wrong?
      Ok, I understand. I should unshift for my purposes instead of push.