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

Re: Re: My first stab at OO perl...

by mp (Deacon)
on Jul 16, 2002 at 16:57 UTC ( [id://182154]=note: print w/replies, xml ) Need Help??


in reply to Re: My first stab at OO perl...
in thread My first stab at OO perl...

You could conserve resources by generating constructors at "compile" time rather than every time the constructor (new) is called. Class::MethodMaker could do this for you:
use Class::MethodMaker get_set => [ qw( accessor1 accessor2 ) ];
Or you could update 'new' above to check to see if the accessor exists before re-building it.

Replies are listed 'Best First'.
Re: Re: Re: My first stab at OO perl...
by dragonchild (Archbishop) on Jul 16, 2002 at 18:18 UTC
    Fine. Change the = to ||= and it's ok.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Log In?
Username:
Password:

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

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

    No recent polls found