maria80e has asked for the wisdom of the Perl Monks concerning the following question:
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**
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Object is to be passed between different version of scripts
by 1nickt (Canon) on Apr 10, 2020 at 17:53 UTC | |
|
Re: Object is to be passed between different version of scripts
by clueless newbie (Curate) on Apr 11, 2020 at 02:22 UTC | |
|
Re: Object is to be passed between different version of scripts
by jcb (Parson) on Apr 10, 2020 at 23:25 UTC | |
by Fletch (Bishop) on Apr 11, 2020 at 03:09 UTC | |
by maria80e (Novice) on Apr 11, 2020 at 03:25 UTC | |
by marto (Cardinal) on Apr 11, 2020 at 06:26 UTC | |
by jcb (Parson) on Apr 12, 2020 at 03:48 UTC |