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

Re: Class::MethodMaker initialization of default values

by samtregar (Abbot)
on Jul 01, 2002 at 23:58 UTC ( [id://178733]=note: print w/replies, xml ) Need Help??


in reply to Class::MethodMaker initialization of default values

How about (untested):

package Simple; use Class::MethodMaker get_set => [qw(a b)], new_hash_init => 'hash_init'; sub new { my $pkg = shift; my %args = ( b => "default", @_ ); return $pkg->hash_init(%args); }

-sam

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-23 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found