Object is to be passed between programs: Facing an issue while passing object as an input parameter to different perl versions from perl5.6.pl to perl5.24.pl. Provided below the code which has the problem. Using windows platform, how to solve this issue.
The reason to transfered the object from 5.6 to 5.24 is to invoke the web service which supports TLS 1.2 and also the output(live object) needs to be transferred from 5.24 to 5.6.
In the current program same object is used for input and output module.
Object flow : perl5.6 -> perl 5.24 -> web service written as perl module.
SharedBetweenPerls.pm:-
package SharedBetweenPerls; use warnings; use strict; use Exporter; our @ISA = 'Exporter'; our @EXPORT_OK = qw(getVal); sub new { my $self = { roleId => undef, username => undef, }; bless $self, 'SharedBetweenPerls'; return $self; } sub getVal{ my ($self) = @_; return $self->{'roleId'}; } 1;
v5.24.pl:- use warnings; use strict; use v5.24; use lib '.'; my ($self) = @_; print $self->{'roleId'};
v5.6.pl:- use warnings; use strict; use lib '.'; use SharedBetweenPerls; my $obj = new SharedBetweenPerls(); $obj->{'roleId'} = '10000'; $obj->{'username'} = 'test123'; my $roleId = $obj->getVal(); print "Value : $roleId \n"; my $from_5.24 = qx(path-to-perl-5.24 program_for_5.24.pl "$obj"); print "Return from function: $from_5.24"; **#Not Working**
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |