Re: CPAN.pm programming
by CountZero (Bishop) on Nov 22, 2009 at 07:46 UTC
|
For a custom install of CPAN, best to directly change the list of repositories in the configuration file. You can do that manually, or let the mkmyconfig function of CPAN.pm take care of it.From the docs: Default values defined in the CPAN/Config.pm file can be overridden in a user specific file: CPAN/MyConfig.pm. Such a file is best placed in $HOME/.cpan/CPAN/MyConfig.pm, because $HOME/.cpan is added to the search path of the CPAN module before the use() or require() statements. The mkmyconfig command writes this file for you.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] [d/l] [select] |
|
Yep, and the specific configuration key within that file is urllist, e.g.:
$CPAN::Config->{urllist} = [q[ftp://some.site.com/cpan/], q[http://cpa
+n.elsewhere/]];
They are checked in the order in which they appear, falling through to later entries if the connection fails or if a particular name can't be found. | [reply] [d/l] [select] |
Re: CPAN.pm programming
by syphilis (Archbishop) on Nov 22, 2009 at 07:23 UTC
|
I know how to do it from the shell
Just run those shell commands inside system() calls.
Cheers, Rob | [reply] |
Re: CPAN.pm programming
by JavaFan (Canon) on Nov 22, 2009 at 11:26 UTC
|
Why not just put the modules you need in place? Shipping a minicpan and then installing it from said minicpan seems like the long way around. | [reply] |
|
Perhaps because of license issues? For example, DBD::Oracle needs to be linked against Oracle client libraries, but most times, you do not have the permission to redistribute those libraries.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] |
|
So? You could still compile DBD::Oracle and distribute it.
| [reply] |
|
The nature of the application is that it will be updated pretty regularly with new features that may or may not require CPAN modules. By having a miniCPAN available I can use most any module and not have to worry about dependancies and such. I am sending the client a CD, might as well fill it with what I might need.
| [reply] |
|
But if you're going to update your application, you'll have to send your client something anyway - might as well then send the modules you need. You also may need a module, or a version of a module that wasn't present in the minicpan you deliver on CD.
| [reply] |
|
|
|