Perl tip for the day: “only”

The EBI hosts an excellent tool called InterProScan, for finding conserved domains in protein sequences. Even better, there’s a SOAP-based web service and associated perl script, allowing you to submit sequences from the command line.

The only problem is that the script requires SOAP::Lite version 0.60 to work. SOAP::Lite on my machine is the latest, 0.69. Fortunately, Perl allows you to install older module versions in a special place, away from the others. All you need to do is:

  • Use CPAN to install the module “only” (
  • Download the old module version that you want from CPAN
  • Unpack the tarball and run “perl Makefile.PL”, “make” and optionally “make test”, as usual
  • Now run “sudo perl -Monly=install”, instead of “sudo make install”

You should see lines of output such as:

Installing /usr/local/share/perl/5.8.7/version-lib/0.60/SOAP/

where version-lib/0.60 is the special location for older versions.

Finally, include a line like this in your Perl:

use only SOAP::Lite => '0.60';

It would be nice if web service maintainers kept their scripts up to date with the newest module versions – but this is the next best solution.