How to install perl package Class/CSV.pm using port?

Ryan Schmidt ryandesign at macports.org
Sun May 29 21:25:05 PDT 2011


On May 29, 2011, at 21:57, Peng Yu wrote:

> I get the following error when I run a perl script. Class/CSV.pm is
> missing. I remember that I should use port rather than cpan to install
> perl modules. But I'm not sure how to find the corresponding port
> package for any given perl module. Is there a systematic naming
> convention for converting module names from perl to port? What port
> package is form Class/CSV.pm?

The general rule is to take the proper Perl name of the package (in this case, "Class::CSV"), convert to lowercase, replace the double colons with dashes, and prepend "p5-". So "Class::CSV" would be available in the port "p5-class-csv", which doesn't exist yet, but could easily be created; I'll do this for you shortly.

Some perl packages contain more than one module, in which case you have to discover by some other means what the main package name is, then see if we have a port for that.

cpan2port is a tool that can be used as a first step in creating a portfile for a perl module. Once a portfile generated with cpan2port is cleaned up and tested, it can be submitted as a new port in our issue tracker.






More information about the macports-users mailing list