Help for this page

Select Code to Download


  1. or download this
    has priv_attr => (
        is        => 'rw',
    ...
        reader    => '_priv_attr',
        writer    => '_priv_attr'
    );
    
  2. or download this
    sub do_stuff {
        my $self = shift;
        $self->_priv_attr( 1 );
        $self->_priv_attr;
    }
    
  3. or download this
    Attribute (priv_attr) does not pass the type constraint because: Valid
    +ation failed for 'Str' with value undef at ./test.pl line 22
            Foo::do_stuff('Foo=HASH(0x8d02c18)') called at ./test.pl line 
    +28
    
  4. or download this
    #!/usr/bin/env perl
    
    ...
    }
    
    Foo->new->do_stuff;