CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Good lord, installing modules is a PITA. Help Please!

 



srhadden
Novice

Mar 2, 2012, 9:06 PM

Post #1 of 5 (1603 views)
Good lord, installing modules is a PITA. Help Please! Can't Post

Hi All.

I am on the Mac OS Lion, installed the dev tools.

I am running:

sudo cpan

I run:

o makepl_arg, because I don't want to muck up my core install. I want these local to be moved around.

Anyway,

cpan> install <module>

Basic modules install. But more complicated ones like Email::Sender just bomb and really I have little patience to sift through cryptic logs and so on.

Can someone give me some good advice here? Now, I wanted to install manually, but then if I download it and run perl Makefile.PL, I just get an instant bomb because I don't have the pre-reqs.


budman
User

Mar 4, 2012, 10:27 AM

Post #2 of 5 (1539 views)
Re: [srhadden] Good lord, installing modules is a PITA. Help Please! [In reply to] Can't Post

 
If you need to install the modules to its own lib dir
check out

http://search.cpan.org/dist/local-lib/lib/local/lib.pm

cpan install local::lib

To have cpan install any pre-reqs you need to set the config option

prerequisites_policy [follow]

Then you should be able to do:

# Install LWP and its missing dependencies to the '~/perl5' directory
perl -MCPAN -Mlocal::lib -e 'CPAN::install(LWP)'

For other dirs, check out the docs, it walks you thru other locations.

Are you doing site bundling/archiving libs, where you compile a bunch of modules and then load them onto other servers?

Most modules are built very well and work quite well with the prereq follow, however, there are times when a module sneaks in and the only resolution is checking the log output and just 'cpan install missing::mod'.

Manual installs require you to read any Install or Readme.txt files so you can see what the pre-reqs are and install them. Otherwise, its whack-a-mole until you get the pre-reqs done, and hopefully you got them all.


(This post was edited by budman on Mar 4, 2012, 10:39 AM)


srhadden
Novice

Mar 5, 2012, 12:34 AM

Post #3 of 5 (1493 views)
Re: [budman] Good lord, installing modules is a PITA. Help Please! [In reply to] Can't Post

I simply wanted to learn how to install cpan modules on the Mac. I prefer to install locally to not change my default perl installation.

But I've learned some modules have platform specific code that is compiled. Another question is how do I lookup a module and know if the module is just a plain perl module or if it must compile components for the OS?

In OS lion I followed the instructions fr installing modules and enable the prerequisite option you mentioned. The install just bombed and I wish I knew if the module supported Mac OS or not. Seems like all the cpan models don't even have a Mac OS column in the OS support matrix unless I am missing something.

If my problems are just cuz the Mac doesn't hav good perl module support this fine. Just wanted to know what I was doing wrong to cause practi ally any complex modules w prerequisites to fail.

For example the Email::Sender module. How do I know if it ever has been tested to install on a Mac?

Thanks for any info. Anything is helpful.


budman
User

Mar 5, 2012, 9:51 AM

Post #4 of 5 (1474 views)
Re: [srhadden] Good lord, installing modules is a PITA. Help Please! [In reply to] Can't Post

Many perl modules may have C/C++ libs that help optimize performance or perform complex problem solving. This dependency can lead to cross platform issues, which you are experiencing.

I did a quick search and found a site that may help you.
Its called Mac Ports. http://www.macports.org/index.php

Click on Available Ports

There are many perl modules that were ported. You will need to decipher their naming conventions. Looks like p5.10 for perl5.10, and module name is lower case.

p5.10-email-send 2.192.0

Dependencies: p5.10-email-address p5.10-email-simple p5.10-module-pluggable p5.10-return-value perl5.10

They may have an automated installer for perl modules.


Hopefully, you will find the modules that depend on these external libs have been ported to work on a Mac.

You should have no problem with modules that are pure perl.

The only problem with this dependency on Mac Ports, is just like any other binaries site, you have to hope its actively maintained. The other option is to find out what is required to port the code to Mac. Often times, it may be straight forward - lib paths, lib versions, or compiler/linking options. Other times, it could be subtle differences between BSD and Linux.


srhadden
Novice

Mar 5, 2012, 12:41 PM

Post #5 of 5 (1469 views)
Re: [budman] Good lord, installing modules is a PITA. Help Please! [In reply to] Can't Post

Ahh, ok thank you. I have used MacPorts once before actually.

The web server is on a Linux machine, but I'm testing prototype work on my Mac.

Is there a way to tell if a module is pure perl or not? Perhaps just download the package and search for .c files or something?

Just a curiosity now.

Thank you for the help!

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives