Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Getter and Setter Function Names

by DrManhattan (Chaplain)
on Apr 09, 2003 at 22:39 UTC ( #249461=note: print w/replies, xml ) Need Help??

in reply to Getter and Setter Function Names

Assuming you're referring to object methods, I take a different stance than Ovid. I like using overloaded methods that match my variable/column names. For instance, if my object represents a database row with a "salary" column,
$object->salary() # returns the value of salary $object->salary(1234) # sets salary to 1234

In the end what really matters, though, is that you establish a standard practice and follow it. The exact nature of the practice is less important than your consistancy in adhering to it.


Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2023-12-10 21:23 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.