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

Re: Self creating OO Module field accessors...

by Corion (Patriarch)
on Jan 12, 2006 at 22:37 UTC ( [id://522829]=note: print w/replies, xml ) Need Help??


in reply to Self creating OO Module field accessors...

Inheriting from Class::Accessor gives you the mk_accessors method:

package Big::Thing; use strict; use base qw(Class::Accessor Small::Thing Needful::Things); __PACKAGE__->mk_accessors(qw(field1 field2 field3)); sub new { ... return $package->SUPER::new({ %args }); };

Class::Accessor has the shortcoming that its constructor wants to be passed a hash reference. So you need to either override the default constructor or live with that.

Log In?
Username:
Password:

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

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

    No recent polls found