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