Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Moose and default values

by morgon (Priest)
on Feb 20, 2013 at 22:13 UTC ( [id://1019851]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Foo;
    
    my ($bar) =  @ARGV;
    my $foo = Foo->new( bar => $bar );
    
  2. or download this
    package Foo;
    use Moose;
    
    has bar => (is => "ro", default => "whatever");
    
  3. or download this
    package Foo;
    use Moose;
    ...
    
      $this->bar("whatever") unless defined $args->{bar};
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1019851]
Approved by muba
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-20 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found