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**

In reply to Object is to be passed between different version of scripts by maria80e

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.