We have two versions of Active perl 5.6 and 5.24. We have web services which has 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. We are using windows operating system.
Steps followed : Caller code which is executed in 5.6 version invokes the 5.24 version using system /require command.
Problem: How to call the 5.24 perl function(example: webservicecall(arg1){return "xyz") from 5.6 perl script through system command, require or etc..? Also how to get the return value of perl function 5.24?
Note: Its a temporary work around to have two perl versions and the we have a plan to do upgrade it for higher version.
Here perl version 5.6 installed in "C:\Perl\bin\perl\" and perl version 5.24 installed in "D:\Perl\bin\perl\".
p5_6.pl print "Hello Perl5_6\n"; system('D:\Perl\bin\perl D:\sample_program\p5.24.pl'); print $OUTFILE; $retval = Mul(25, 10); print ("Return value is $retval\n" );
p5_24.pl print "Hello Perl5_24\n"; our $OUTFILE = "Hello test"; sub Mul($$) { my($a, $b ) = @_; my $c = $a * $b; return($c); }
I have written sample program for detail information to call perl 5.24 version from perl script 5.6 version. During execution I didn't get the expected output. How to get the "return $c" value & the "our $OUTFILE" value of p5_24.pl in p5_6.pl script?
Note: The above is the sample program based on this I will modify the actual program using serialized data.
In reply to Calling perl function from another perl script with different Active perl versions by maria80e
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |