skip to Main Content

I have been running a purchased Perl script for over 15 years. I have been upgrading it fairly regularly, until the developer abandoned it about 5 years ago. I have some VERY basic knowledge, and have been limping it along without the dev support until my webhost forced a server upgrade to Debian, which included an upgrade from Perl 5.14 to 5.28! UGH!

I am scrambling here! It appears that my biggest problems are outdated modules and that I can no longer access LOCAL::LIB

I know that the version docs list all the changes, but since I didn’t write the scripts, I just modify them, I don’t know what to even look for in 50,000 lines of code.

Can someone help with a "Here’s what you have to upgrade" for Dummies? I can run command line through SSH if someone can point me in the direction of WHAT I need to do. Google is not helping for once.

Here is one of the errors

Can’t locate local/lib.pm in @INC (you may need to install the
local::lib module)

(@INC contains: /home/directory/website.com/../cgi-bin/perlmodules

/home/directory/website.com/cgi-bin/perlmodules

../../cgi-bin/perlmodules

../cgi-bin/perlmodules

./perlmodules

/etc/perl

/usr/local/lib/x86_64-linux-gnu/perl/5.28.1

/usr/local/share/perl/5.28.1

/usr/lib/x86_64-linux-gnu/perl5/5.28

/usr/share/perl5

/usr/lib/x86_64-linux-gnu/perl/5.28

/usr/share/perl/5.28

/usr/local/lib/site_perl

/usr/lib/x86_64-linux-gnu/perl-base) at
/home/directory/website.com/cgi-bin/fsfstore.cgi line 52.

BEGIN failed–compilation aborted at
/home/directory/website.com/cgi-bin/fsfstore.cgi line 52.

2

Answers


  1. Chosen as BEST ANSWER

    The main issue ended up being the scripts themselves.

    In case anyone else comes looking because it took me FOREVER to get this straightened out. These sites are hosted on Dreamhost. Running bash using SSH.

    I ended up having to install PerlBrew, following the instructions on their site: PerlBrew I'm linking in case the instructions change, and if the link breaks, then they're gone anyways. At the time of this writing, using curl worked for me.

    Once I had PerlBrew installed with the version of perl that I wanted. I installed cpanm for easy module installation

    [server]$ perlbrew install-cpanm
    

    the problem with my script is that it used a shebang #!/perlpath on the first line.

    I had to change the shebang on the first line of the script to:

    #!/home/user/perl5/perl5/perlbrew/perls/perl-X.X.X/bin/perl
    

    replacing "user" with the username and "perl-X.X.X" with the perl version you want to use.

    Update the script then have a browser window open and your terminal window open.

    Next, use the error when you try to load the page to figure out what modules to install. The error will say "can't locate module/mod.pm". Take that and in terminal use cpanm to install by replacing the / with ::

    [server]$ cpanm module::mod
    

    That will run the install for the missing module, refresh your page, and repeat until everything works like it should.

    WARNING! the modules are case sensitive, so if it is erroring that it can't find the module, make sure you have it typed correctly.

    Good luck!


  2. Presumably the local::lib module is installed in your 5.15 tree but not in your 5.28 tree. There are a number of mechanisms to install perl modules. Eg:

     sudo cpan install local::lib
     sudo cpanm install local::lib
     sudo apt install liblocal-lib-perl
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search