Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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 wandering the Monastery: (4)
As of 2017-08-20 21:16 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (317 votes). Check out past polls.