![]() |
|
more useful options | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
There are a gazillion Class:: modules that will do that for you. What you also can do is:
Then you won't have any runtime penalty due to AUTOLOAD, or whatever runtime solution your Class:: choice uses. Or you could use a smart editor that allows you to create an accessor using a macro. Personally, if I find myself making enough accessors in a class that I start contemplating automating it, I wonder whether I really need an object, or whether I'm just creating a glorified struct. It's usually the latter - and Perl already has an excellent data structure to use as a struct: it's called a hash.
Perl --((8:>*
In reply to Re: Self creating OO Module field accessors...
by Perl Mouse
|
|