Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Checking for Presence of Optional Attribute in Moose Object

by FalseVinylShrub (Chaplain)
on Jul 04, 2010 at 04:41 UTC ( #847954=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    has 'age'  => ( 
      is  => 'ro',
    ...
      predicate => 'has_age'
    );
    if ($self->has_age) { ... }
    
  2. or download this
    has 'age'  => ( 
      is  => 'ro',
      isa => 'Str',
      default => '',
    );
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2014-10-21 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (106 votes), past polls