Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Perl Upgrade with Redhat Linux OS Upgrade

by shijith (Novice)
on Sep 26, 2019 at 09:09 UTC ( [id://11106728]=perlquestion: print w/replies, xml ) Need Help??

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

Hello ,

We are using 5.8 version of perl in our organization configured on red-hat linux version 5.X, along with apache, but now the client wants to upgrade perl to latest 5.20 and also they want to upgrade the Operating system to Redhat linux 7.X. What are all the major changes and key points that must be keep in mind before starting an upgrade. is it advisable to move this much this much lower version to advanced level. Could you please suggest me a solution.

  • Comment on Perl Upgrade with Redhat Linux OS Upgrade

Replies are listed 'Best First'.
Re: Perl Upgrade with Redhat Linux OS Upgrade
by roboticus (Chancellor) on Sep 26, 2019 at 13:28 UTC

    shijith:

    You've already gotten some good advice, I'll just toss in one thing I didn't see yet:

    Be sure to ensure that you keep the version of perl used by your operating system separate from that used by your application. That way you can more easily avoid surprise failures when applying security upgrades to your OS or installing new modules for your application.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re: Perl Upgrade with Redhat Linux OS Upgrade
by marto (Cardinal) on Sep 26, 2019 at 09:28 UTC

    "What are all the major changes and key points that must be keep in mind before starting an upgrade."

    It sounds like a good time to start your research. The latest 5.24 release is 5.24.4, that that isn't the most recent perl version. 5.24.4 history/changes is a good place to start. A sane strategy would be to fully test your application(s) thoroughly on the target OS/Perl version.

      thanks for the update.. is there any other option available instead of checking each file.

        You could cat them all together if you think that would help? Or on the target OS, with the target Perl version, run all your test suites, examine the outcome.

        You can use find:

        find /path/to/the/scripts -name '*.pl' -exec perl -wc {} \;

        perl -wc is to check the syntax of the scripts. They should give "OK" back, but that is not a guarantee to run correctly, though; only that the libraries are found and the syntax is ok according to Perl.

        This only works if the perl scripts have the .pl extension (which is not mandatory).

Re: Perl Upgrade with Redhat Linux OS Upgrade
by 1nickt (Canon) on Sep 26, 2019 at 10:10 UTC

    Hi, given that the customer wants to also upgrade the OS I recommend doing that first on a test machine. Then see whether the application works as-is on the system Perl that is installed with the RedHat version you use. Next, install Perlbrew and use it to either try with the Perl version you want to use, or fall back to 5.8 and work from there.

    As others have said, if you do not have a comprehensive test suite that can prove your application has not broken (as far as you know), you should develop that first before attempting any upgrades to anything.

    Hope this helps!


    The way forward always starts with a minimal test.
Re: Perl Upgrade with Redhat Linux OS Upgrade
by FreeBeerReekingMonk (Deacon) on Sep 26, 2019 at 20:21 UTC
    Headsup: Focus on *.pm used libraries.

    Usually with big Perl programs, they "use" libraries, that sometimes are not backwards compatible, or suddenly cease to exist after the upgrade. Or are not available for your new perl version. so check if you did not forget any library. Perl Libraries are also sometimes NOT written in pure perl, but in C (or C++) for speed (through a method called XS). So on this totally new RHEL7, you need to make sure these are there too. And copying them over is sometimes possible, sometimes not. (hopefully all your libraries are on CPAN and not in-house)

    What I would do is an strace perl myperlprogram.pl and see what files are being used. There are better tools, like PrereqScanner but those need to be installed, and your machines probably do not have access to Internet, thus no access to CPAN (but if you do, it is as simple as: cpan Perl::PrereqScanner)

    Also check the old version to make the new perl behave like it is an older perl (use VERSION). This is handy when your new perl does not want to run the old perl code because there is a bug, and that bug worked fine in the older perl.

Re: Perl Upgrade with Redhat Linux OS Upgrade
by Anonymous Monk on Sep 26, 2019 at 09:37 UTC
    Install perl 5.20 in a home directory and run test suite for every program your client eants( Perlbrew). Write a test suite if not have one. Read perldeltas and equivalent redhat changes/migration document
      Thanks for your reply ,

      Could you please share any document for redhat changes/migration document. Thank you !!

        This sounds like research you should be doing, this isn't a perl related issue.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11106728]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found