Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Spliting own program distribution intoi several modules.

by Corion (Pope)
on Dec 27, 2012 at 08:46 UTC ( #1010470=note: print w/replies, xml ) Need Help??

in reply to Spliting own program distribution intoi several modules.

One way would be to add your private module path before the CPAN module path in @INC so that Perl will prefer local module installations over installations from CPAN:

BEGIN { my $private_module_path = '/usr/local/myscript/lib'; unshift @INC, $private_module_path; }; use Net::MyModule; # will pick up the first Net/ that is fo +und in @INC

An alternative approach would be to load both modules and then try to find out which one has the largert version number, but that is a hairy thing to try and a user who does local modifications might not think of bumping the version number high enough.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2017-02-21 22:30 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (320 votes). Check out past polls.