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?

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.

  • 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 Sep 17 '14 at 8:24
  • 1
    Either you make sure Switch is installed on the newer version, or you stop using switch and use plain if/elsif/else constructs. – szabgab Sep 17 '14 at 9:02

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.