Help for this page

Select Code to Download


  1. or download this
    has '_posts' => (is => 'ro', lazy => 1, traits => ['Hash'], isa => 'Ha
    +shRef[HashRef]', builder => '_load_posts',                           
    +     
                    handles => { set_post => 'set', get_post => 'get', num
    +_posts => 'count',                                                   
    +    
                    post_pairs => 'kv', post_keys => 'keys' }, writer => '
    +_set_posts');
    
  2. or download this
    use Storable;
    store { {} }, $file;  # This line needs to be changed.
    ...
    $s->_set_posts(retrieve $file);
    
  3. or download this
    Attribute (_posts) does not pass the type constraint because: Validati
    +on failed for 'HashRef[HashRef]' with value 1 at native delegation me
    +thod Site::Posts::num_posts (count) of attribute _posts
    
  4. or download this
    
    package Site::Posts ;
    ...
    
    1;