- or download this
package MyClassA;
...
}
1;
- or download this
package MyClassB;
...
}
1;
- or download this
use strict;
use warnings 'all';
...
$a->setClassB($b);
print JSON->new()->convert_blessed()->encode($a) . "\n";
- or download this
use strict;
use warnings 'all';
...
my $a = bless(JSON->new()->decode($line), 'MyClassA');
print $a->getClassB()->getName() . "\n";