Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Perl OO with Class::Struct

by davido (Archbishop)
on Dec 13, 2013 at 16:09 UTC ( #1067035=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Cat;
    use Moo;
    ...
    for (@{$litter->cats}) { 
        print $_->name . "\n"
    }
    
  2. or download this
    isa => sub {
      my $param = shift;
    ...
          unless ref $element eq 'Cat';
      }
    }
    
  3. or download this
    die "<<$element>> must have a name attribute"
      unless $element->can('name');
    
  4. or download this
    isa => ArrayRef[ InstanceOf['Cat'] ]
    
  5. or download this
    isa => ArrayRef[ HasMethods['name'] ]
    
  6. or download this
    package Cat;
    use Moo;
    ...
    );
    
    print $_->name . "\n" for @{ $litter->cats };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067035]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-07-31 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (253 votes), past polls