Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: declaring accessor methods from a list

by ferreira (Chaplain)
on Apr 27, 2007 at 11:31 UTC ( [id://612352]=note: print w/replies, xml ) Need Help??


in reply to declaring accessor methods from a list

As AK108 pointed out, Class::Accessor is a nice module to do what you want and like it a lot as well. With it, your code would turn to be:
package Bro::Doug ; use strict ; use warnings ; use base qw(Class::Accessor); __PACKAGE__->mk_ro_accessors( qw(one two three) ); 1;
and you will get the accessors and the new constructor for free.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 06:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found