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

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/MyModule.pm 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.


Comment on Re: Spliting own program distribution intoi several modules.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2015-07-31 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls