Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Apply a source filter to all modules to be loaded?

by Corion (Pope)
on Mar 05, 2007 at 18:44 UTC ( #603267=note: print w/replies, xml ) Need Help??

in reply to Apply a source filter to all modules to be loaded?

This is crazy talk, but that's not stopping Perl from having it, see require:

sub my_own_loader { my ($self,$file) = @_; open my $fh, "<", "my/private/dir/$file" or return; $fh }; BEGIN { unshift @INC, \&my_own_loader; }; use Foo::Bar; use The::Net;

You might also want to look at Filter::Simple, but please realize that source filtering isn't a sane practice :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603267]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2017-06-25 01:27 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (564 votes). Check out past polls.