Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Invokes perl modules from perl script in different perl versions

by maria80e (Novice)
on Apr 07, 2020 at 17:33 UTC ( [id://11115177]=perlquestion: print w/replies, xml ) Need Help??

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

We have two versions of Active perl 5.6 and 5.24. We have web services which is written as perl modules to be executed on Active perl '5.24' versions(to adopt TLS 1.2 version) and this needs to be invoked from Active perl '5.6' version.

Is there any feasibility to do the following Main Program runs on 5.6 version perl modules to be executed in 5.24 version Perl modules are invoked by main program which runs on 5.6 version.

For the below example,

Example:-

TestMain.pl (5.6 version) use webser; my $result = qx{C:/Perl_524/bin/perl.exe D:/webser.pm};

Expected Result: the expected result is Main program which runs on 5.6 invokes the perl module which has to be run on 5.24 version and returns the result.

During the execution we noticed that the perl modules runs on 5.6 instead of executing on 5.24.

Note:

1. The input paramter for the web services are binded in the object created for the module

2. we tried system command too and its not worked as expected

3. Perl modules returns the response of the webservice to the main program

4. Having two versions of a perl is a work around and later we upgrade it into higher version

5. Working on windows platform

Replies are listed 'Best First'.
Re: Invokes perl modules from perl script in different perl versions
by choroba (Cardinal) on Apr 07, 2020 at 17:42 UTC
      Here perl 5.6 version not supports TLS 1.2 version so it throws an exception.
Re: Invokes perl modules from perl script in different perl versions
by stevieb (Canon) on Apr 07, 2020 at 17:54 UTC

    I fail to understand why you don't just re-write everything properly on a current version of Perl (or at least the latest version you've got).

    It'd probably be quicker and more resilient, upgrade-friendly and stable long-term as opposed to continuously trying to build and maintain a differing-version abstraction layer.

      Having two versions of a perl is a work around and later we upgrade it into higher version, because its a big project need more efforts.

        You know, most scripts written for Perl 5.6 will run fine on Perl 5.24 without modification. And you've clearly got Perl 5.24 available. So I don't see why it is a "big project".

        Like a number of other monks, I don't understand why you don't use version 5.24 of Perl and the necessary TLS interface module and solve the problem without involving Perl 5.6 at all. It would be helpful if you could explain this point. Is it perhaps the case that Perl 5.6 is the system Perl on the server in question and you are unsure about how to install and run a later Perl version?

        If you avoid the work-around and just do the work, you may find that you have a lot less work to do. See XY Problem.


        Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found