Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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 about the Monastery: (6)
As of 2017-01-17 17:36 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (158 votes). Check out past polls.