Help for this page

Select Code to Download


  1. or download this
    use v5.12;
    use strict;
    ...
    
    my $inflated = MyClassA->new( JSON->new->decode($json) );
    say $inflated->getClassB->getName;
    
  2. or download this
            isa      => InstanceOf->of('MyClassB')->plus_constructors( Has
    +hRef, 'new' ),
            coerce   => 1,
    
  3. or download this
        if ( exists $extras{MY_CLASS_B} and ref $extras{MY_CLASS_B} eq 'HA
    +SH' ) {
            $extras{MY_CLASS_B} = MyClassB->new( %{ $extras{MY_CLASS_B} } 
    +);
        }