The version of perl that my Terminal command-line shows is the one installed from Macports. Does that affect the answer?
You have apparently already used MacPorts to install Perl, so I don't see any reason not to use it to install the modules. On the other hand, you can certainly use CPAN as long as you make sure the cpan command you use is the one installed by MacPorts. Otherwise, modules could be installed in the wrong locations and not be accessible.
When I installed WeBWorK under Snow Leopard and earlier OS X versions, I used MacPorts to install all but one of the modules. The names for the modules were easy to deduce from the FreeBSD names in the table in the WW 2.4 installation manual. A quick search on the MacPorts site is all that is needed to confirm the name. I believe that I once wrote up an html fragment that added a column to this table with the MacPort names for the modules. I could probably find it if you are interested.
I think the biggest advantages to using MacPorts are the following.
1. MacPorts takes care of dependencies. That is, if you try to install a module, but it depends on modules you don't have installed, MacPorts goes ahead and installs them for you.
2. Keeping your installation up to date is very easy with MacPorts.
The one module I couldn't find on the MacPorts site I installed using CPAN.
I don't currently have access to a Mac with Mavericks.
I think I've put together the pieces on how to identify the MacPorts Perl modules I need to install to satisfy WeBWorK's requirements:
- From the WeBWork installation directory, which is /opt/webwork/webwork2_github, run:
- After installing clan, run: sudo perl -MCPAN -e shell
- Inside that shell, for each module listed from output in step 1, e.g., Date::Format, run corresponding command:
- From the indicated CPAN_FILE found in step 3, e.g., TimeDate-x.xx.tar.gz, find the corresponding Macports port:
port search timedate
- Install that Macports port, e.g.:
port install p5-timedate
(I haven't dealt yet with the complexity of creating ports for any modules not yet having MacPorts ports already.)
This is not the same as using the macport version of the modules. I think there is a macports "port" of every module you need, but you would need to determine its name and use "sudo port install modulename" where modulename is things like p5-data-uuid, p5-timedate, p5-soap-lite, etc. I think one can guess the module name from the perl module by using hypens instead of :: and prefixing it with p5 (for perl 5).
John is correct, the MacPort names aren't hard to guess, especially if you start from the FreeBSD names in the table in the WeBWorK 2.4 installation manual. I once copied the html for the table and added a column with the MacPort names for the required modules. I've attached the html fragment to this message in case there is any interest.
The table only includes the modules required for WeBWorK 2.7.