Help for this page

Select Code to Download


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