perl upgrade, req to understand which modules to install

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I am not used to perl myself but have to upgrade different perl installs
on a server. There are many previous perl versions which we want to
upgrade to say, perl 5.8.0 (as an example). There are hundreds of perl
scripts on the server which use different versions.

what's the best path to follow?

what I have done is this:
- find all modules on each perl installation. there are many differences
versus the reference version (5.8.0 in this example)
- find all 'use' and 'require' on all perl scripts. I have a file with a
sort | uniq of these. but there are a lot of options which I really
don't know yet if are extra modules by themselves (as I have not really
used perl before) This approach would save me from install unrequired
perl modules on the reference version.

I think the second option is the best, but then I have this kind of
list. Are these different submodules, or just options for the same

CGI ':all'
CGI qw (:standard)
CGI qw(-oldstyle_urls :standard)
CGI qw(:cgi)
CGI qw(:standard -private_tempfiles)
CGI qw(:standard)
CGI qw(param)
CGI qw/:all cgi-lib/
CGI qw/:all/
CGI qw/:standard/

Thanks in advance

Re: perl upgrade, req to understand which modules to install

Quoted text here. Click to load it

Just in case it isn't only an example: Avoid 5.8.0. As the first release
of the 5.8.x series it had many problems which were fixed in later
releases. Use the latest 5.8.x release if possible.

Quoted text here. Click to load it

Since there are already many perl versions on the server, I assume you
can install the new version without uninstalling the old ones. This
allows you to switch a few scripts at a time - you don't have to switch
all of them at once.

Also: Do you have a test server where you can test the scripts before
changing them on the production server?

Quoted text here. Click to load it

That's also my first step at compiling a list of modules I need to install.
However, I have the advantage that I wrote most of the perl scripts
which are running on our servers.

Quoted text here. Click to load it

Generally you can ignore the options, as they just modify the behaviour
of the module (e.g., they are often used to tell the module which
functions should be exported). In rare cases an option may cause a
module to load another module, but

a) you cannot infer this from the use command - you have to read the
docs, and

b) this can also happen after use. For example, the DBI module decides
which of the DBD::* modules it has to load only when connect() is

So this is a way which may require quite a bit of work and perl

Quoted text here. Click to load it

   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   |         | Was sonst wäre der Sinn des Erfindens?
__/   | |    -- P. Einstein u. V. Gringmuth in desd

Re: perl upgrade, req to understand which modules to install

Peter J. Holzer wrote:
Quoted text here. Click to load it

<snip />

Quoted text here. Click to load it

These are both _really_ good ideas, since module upgrades are
occasionally incompatible. DBD did this to me once -- the upgrade added
warning messages for things like running off the end of a cursor, and
supression required clearing an attribute that the old version didn't have.

If you're desperate, a test server of a different architecture than the
server you're converting may be better than nothing - unless you're
converting Windows, which I assume you're not since you're doing things
like 'sort | uniq';

One of the complications is that modules come in packages. Module CGI
happens to come in package CGI, but module LWP::UserAgent (and a lot of
others) come in package libwww-perl.

Unless you are using ActivePerl, you should find somewhere in each
Perl's module directories a file called 'perllocal.pod'. This will list
each package that has been installed in that version of Perl. This is a
superset of what you want, but may be useful as a reference.

<snip />

Tom Wyant

Site Timeline