Setting Up CPAN
To install Perl modules using cpan, you need to configure it and install the necessary open source dependencies.
Follow these steps to set it up:
Prerequisites
-
wget -
tar -
bzip2 -
gzip
You can install wget, tar, gzip, and
bzip2 from the zopen community.
Configuring CPAN
1. Initialize CPAN
Run the following command to enter the CPAN shell:
cpan
If this is the first time running CPAN, it will prompt for initial configuration. You can choose automatic configuration (press enter) unless you need custom settings.
If the current CPAN configuration is incorrect, reset it using:
rm -rf ~/.cpan
cpan
2. Set Up CPAN Configuration
If cpan detects the z/OS version of make and tar and fails the initial setup,
then you can configure it to pick up the zopen tools with the following:
cpan
o conf make /path/to/oef/make
o conf tar /path/to/zopen/tar
# do the same for wget, gzip, and others as needed...
o conf commit
Verify that the ~/.cpan/CPAN/MyConfig.pm file is updated accordingly by viewing
it.
3. Install Required Modules
Once CPAN is set up, install Perl modules as needed:
cpan install Switch
Troubleshooting
- If CPAN fails due to missing dependencies, verify that
wget,tar,make,gzip, andbzip2are properly installed and referenced in the~/.cpan/CPAN/MyConfig.pmfile. - If CPAN configuration is incorrect, reset it
using:
Then re-runrm -rf ~/.cpancpanto reconfigure.