If you use perl in anger you will want to update some of the perl modules. I had to climb this particular hill recently when I needed the perl DBI module to access a database, more specifically, the DBD ::Oracle module to access an Oracle database. The most straight forward and popular method for installing perl modules is to use CPAN.
Whether you use CPAN or compile by hand, the first, not so small issuette you will hit is that the perl in Solaris is compiled with the Sun Studio compilers. This will fire up a CPAN shell for you to use. Below is an account of the configuration tweaks I had to do to get this CPAN shell to download, compile and install my modules. Do not let it autoconfigure, instead answer [yes] to being ready for manual configuration.
So I will use it in the following examples. The funny :: between Data and Dumper is kind of like a directory separator. Data::Dumper comes installed by default, along with hundreds other modules that the developers deemed worthy. To test that your Perl distro has it, run the following command in a command line:.
BEGIN failed—compilation aborted. To install a module, you can do it the hard way or the easy way. First, you should know where to find your module. There you will find code ranging from the most trivial to the craziest needs.
Enter a keyword in the search engine and it will list all relative modules. Click on the link to the one that interests you most. You will see lots of information about the module and its sub-modules, but what should concern you right now is the download link next to the release name. Click on it and download the module tarball.
Now this is where I halt and tell you that potential headaches lie ahead. There are basically 2 kinds of modules: PurePerl ones and C-based ones. PurePerl modules are just that — modules that are solely written in Perl.
The vast majority of modules, however, are written in C with bindings special for Perl. Unpack your module in some directory where you have full access.
I like to keep an untouched copy of the tarball, by reading the gunzipped contents and throwing it to the screen with the -c option, and piping it to tar with xvf - parameters:.
Depending on the module, you should have no issues whatsoever. Perl comes with the CPAN module installed, and most of the time it also creates a script in the bin directory called cpan. Sticking to the default values is almost always OK. One of the first questions you will be asked is if you want CPAN to configure everything automatically. I recommend against it unless you know that the defaults are correct and will enable you to successfully install modules.
And if you know that, then you probably already know how to use the CPAN application and this post has nothing new. Once the questions have been answered, you will be presented with a cpan prompt. Use o conf to display the parameters to which you answered all those questions. You can change them with o conf as well. If you are not sure what is the exact name of a module, use the i command to fetch information using a regex:.
Now, unless you already have module Test::Differences installed, Lingua::Klingon::Collate will fail with a dependency error. Not all modules are like that. Some are coded in a way that CPAN actually asks you if you want to follow and install dependencies automagically.
Those are a cinch to install. If something goes wrong, look at the output of the installation. For example, after Lingua::Klingon::Collate failed with the warning that I should have Test::Differences installed, I tried to install that dependency directly.
It also failed. When looking at the output on the screen, I see a bunch of lines like this:. Are you ready for manual configuration? This may be a site-wide directory or a personal directory. CPAN build and cache directory? If you choose so then future builds will take the files from there. If you don't want to keep them, answer 0 to the next question.
How big should the disk cache be for keeping the build directories with all the intermediate files? Cache size for build directory in MB? To prevent from this, disable the cache scanning with 'never'. Perform cache scanning atstart or never? If Storable is not available, the normal index mechanism will be used. If your terminal supports UTF-8, you say no to the next question, if it supports ISO also known as LATIN1 then you say yes, and if it supports neither nor, your answer does not matter, you will not be able to read the names of some authors anyway.
If you answer no, names will be output in UTF If this happens, it can build the prerequisites for you automatically 'follow' , ask you for confirmation 'ask' , or just ignore them 'ignore'. Please set your policy to one of the three values. Policy on building prerequisites follow, ask or ignore? Please correct me, if I guess the wrong path for a program. Where is your gzip program? PL is run by perl in a separate process.
Likewise we run 'make' and 'make install' in processes. If you have any parameters e. Parameters for the 'perl Makefile. PL' command? Typical frequently used setting: -j3 dual processor system Your choice: [] Parameters for the 'make install' command?
As sometimes the Makefile. PL contains question you're expected to answer, you can set a timer that will kill a 'perl Makefile. PL' process after the specified time in seconds. If you set this value to 0, these processes will wait forever. This is the default and recommended setting. Timeout for inactivity during Makefile. Trying ::ffff Not connected. Bad luck Still failed!
0コメント