Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: declaring accessor methods from a list

by ferreira (Chaplain)
on Apr 27, 2007 at 11:31 UTC ( #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? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2023-01-29 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?