Missing Switch module on exiting Perl installation

1

I have been working on a Linux 64bit cluster for months, and this morning it seems as if the Switch module for Perl has disappeared from the system.

If I do a find on the place where I expect it to be, I get:

find /opt/thirdparty/perl/ -name Switch.pm
/opt/thirdparty/perl/perl-5.16.2/lib/5.16.2/CGI/Switch.pm
/opt/thirdparty/perl/perl-5.18.1/lib/5.18.1/CGI/Switch.pm
/opt/thirdparty/perl/perl-5.16.0/lib/5.16.0/CGI/Switch.pm
/opt/thirdparty/perl/perl-5.14.2/lib/lib/5.14.2/CGI/Switch.pm
/opt/thirdparty/perl/perl-5.14.2/lib/lib/perl5/site_perl/5.8.8/CGI/Switch.pm
/opt/thirdparty/perl/perl-5.14.2/lib/5.14.2/CGI/Switch.pm
/opt/thirdparty/perl/perl-5.14.2/lib/perl5/site_perl/5.8.8/CGI/Switch.pm

perl --version

This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux

perldoc POSIX
[...]
perl v5.14.2                      2012-06-26                          POSIX(1)

perldoc Switch
No documentation found for "Switch".

Any ideas? Am I confusing CGI::Switch with Switch?

719016

Posted 2014-09-16T10:21:23.700

Reputation: 2 899

Answers

1

Switch has been indeed removed from the core Perl distribution at version 5.14.0 ( was the cluster just upgraded ? )

While actually using the Switch modules is not recommended, (but I can't find the non-recommendation now) you can get it installed either from CPAN and probably your Linux distribution also provides it as a separate package. It is probably just and apt-get install or yum install away from you.

szabgab

Posted 2014-09-16T10:21:23.700

Reputation: 266

related question: how do I change my code so that it successfully runs on older versions of the Perl interpreter as well as newer ones in my cluster? thanks – 719016 – 2014-09-17T08:24:31.270

1Either you make sure Switch is installed on the newer version, or you stop using switch and use plain if/elsif/else constructs. – szabgab – 2014-09-17T09:02:38.090