3

I'm trying to install a program, but keeps giving an error saying it doesn't find the perl library getopts.pl. My perl version is v5.16.2.

The error message is:

Can't locate getopts.pl in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.16.2/x86_64-linux-thread-multi 
/usr/lib/perl5/site_perl/5.16.2 
/usr/lib/perl5/vendor_perl/5.16.2/x86_64-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.16.2 
/usr/lib/perl5/5.16.2/x86_64-linux-thread-multi 
/usr/lib/perl5/5.16.2 
/usr/lib/perl5/site_perl/5.16.2/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.16.2 /usr/lib/perl5/site_perl .) at ./sqc line 179.

Do you have any idea what is going on? My platform is openSUSE version 12.3 (Dartmouth) (x86_64)

Chris Davies
  • 116,213
  • 16
  • 160
  • 287
  • 1
    Perl libraries usually end with *.pm; anything that uses a *.pl as a library harkens back to the perl4 days (e.g. require 'cgi-lib.pl'). How old is this program? – thrig Aug 21 '15 at 20:13
  • In Debian, getopts.pl is in a package called libperl4-corelibs-perl. Perl 5 was released in 1994, making getopts.pl obsolete, so it's quite an antique. – Gilles 'SO- stop being evil' Aug 21 '15 at 22:08

3 Answers3

8

Why so complicate?

apt-get install libperl4-corelibs-perl
Yifan
  • 81
  • 1
5

Getopt::Std replaced getopt.pl -- you may find it in CPAN Perl4::CoreLibs

try:

cpan> install Perl4::CoreLibs

don_crissti
  • 82,805
bitless
  • 151
1

Depending on the location you installed the getopts.pl, e.g., /home/lib/getopts.pl.  Make sure Perl can see the getopts.pl file by doing the following in your script:

push(@INC, "/home/lib");
require "getopts.pl";

Should be good to go.