sheenzt has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I have a small private website that I use for some data collection amongst a fixed group of people. The data collection was created in 2006 using Perl and so we continued with it for many years until now when our hosting provider upgraded their version of Perl and now the pages on the website have errors coming up and cannot be processed. I do not know Perl but would like to know if there are any resources I can get some information on how to update the script on my side to make it compatible with the updated version of Perl. Thank you,

Replies are listed 'Best First'.
Re: Hosting Provider updated Perl !!
by davies (Monsignor) on Jun 18, 2020 at 16:43 UTC

    One of the updates to Perl changed a default. Perl used to default to searching the current directory for modules, but no longer does so. If you are getting errors suggesting modules are missing, you might try adding use lib '.'; to the code that has the problem. But you will get better answers if you show that code and the errors, and may find it yourself if you try to prepare a SSCCE (http://sscce.org).

    Regards,

    John Davies

      No, don't do that. "." is not the script's directory. You want

      use FindBin qw( $RealBin ); use lib $RealBin;

        Thanks. I'll put that in my toolkit for next time.

        Regards,

        John Davies

Re: Hosting Provider updated Perl !!
by Your Mother (Archbishop) on Jun 18, 2020 at 18:35 UTC

    This exact situation happened to me back before I knew how to segregate my own libraries properly from the system Perl. Broke a bunch of websites and took me a week to sort out because I barely knew what I was doing and I had to reinstall hundreds of modules I hadn’t bothered to track.

    This is potentially the kind of thing you could fix easily with a little good advice from the monks. I posit, however, that it is probably something that is extremely difficult to do with what amounts to a game of charades/Pictionary with you relaying partial information you don’t understand or know how to find to those trying to guess what it means or what you could try next. So, I would say, it might be best to post it as a job on https://jobs.perl.org/ and screen candidates carefully before giving anyone permission/credentials to your site. This is probably a short/easy job for a good Perl hacker.

      1) install perl in $home 2) scandeps to find deps and cpanm to install them 3) adjust shebangs

        Why are you telling a hacker who learned to solve these issues 15 years ago instead of suggesting it to the OP who wouldn’t understand or be able to do any of that? I guess I answered it for you. :P

Re: Hosting Provider updated Perl !!
by Fletch (Bishop) on Jun 18, 2020 at 19:13 UTC

    Other good advice aside, you might contact said provider and ask if they were conscientious enough to keep a copy of the prior version of perl available. If so they may also have instructions on how to diddle your environment to pick that up and get you back running while you transition things to the newer version.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: Hosting Provider updated Perl !!
by kcott (Archbishop) on Jun 18, 2020 at 21:04 UTC

    G'day sheenzt,

    Welcome to the Monastery.

    As already stated by others, you'll need to tell us the previous and new versions of Perl; and, at the very least, we'll need to see some of these errors to have some hope of helping you with this.

    "I do not know Perl but would like to know if there are any resources I can get some information on how to update the script on my side to make it compatible with the updated version of Perl."

    That sounds like you're thinking of doing the updates yourself. Have a read of perlintro: that will give you some basic understanding of the code you're dealing with; in addition, that page is peppered with links to more information about each topic (follow those as required). I'd recommend bookmarking the online Perl Documentation. And, of course, you can ask questions here: we're more than happy to help you learn.

    One place to start fixing your errors would be to look in "Perl Diagnostic Messages". This will tell you about the problem; in many cases, a fix is suggested or a link is provided for more information. The entries in there are generic and use formats to replace certain elements of the message; for instance, "Can't use an undefined value as %s reference". Your error may have the "%s" replaced with something like "an ARRAY" or "a HASH". Don't search for your entire message as it won't be found; look for some part of it (in this example, there's only one match for "Can't use an undefined value").

    When incompatible changes are introduced, they are noted in the deltas (release notes). Links to these are listed in the Miscellaneous section of the online documentation. You generally only need to look at those for versions like "5.NN.0"; the link will have a name like "perl5NN0delta". Versions with a final number other than "0" generally contains minor fixes and updates with no incompatible changes; one notable exception is 5.10.1 which has incompatibilities with 5.10.0. You'll generally find information about how to handle the changes in these documents. As an example, the change indicated by davies is documented in "perl5260delta: Removal of the current directory ("." ) from @INC" with substantial information on how to deal with it.

    Another reason for your errors could be experimental features that were available in the previous Perl version that you were using but have since been removed. The perlexperiment page has information regarding the Perl versions when these features were introduced, deprecated and removed.

    So, that's a number of resources that you may find useful. As stated at the outset, you'll need to provide us with more information to get concrete help on specific problems.

    — Ken

Re: Hosting Provider updated Perl !!
by ikegami (Patriarch) on Jun 19, 2020 at 01:56 UTC

    Instead of relying on the system Perl, you can always install your own (e.g. using perlbrew) to avoid having to face this again.

Re: Hosting Provider updated Perl !!
by Anonymous Monk on Jun 18, 2020 at 16:41 UTC
    not enough info - what errors? whats the code that makes those errors? whats the old version and the new version?