Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Modern Perl: The Book: The Draft

by Anonymous Monk
on Jul 07, 2010 at 00:54 UTC ( #848353=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Modern Perl: The Book: The Draft
in thread Modern Perl: The Book: The Draft

I made the mistake of not looking at the paragraph and associated code.

Of course, the mere existence of a method called name() or age() does not by itself imply the behavior of that object. A Dog object may have an age() which is an accessor such that you can discover $rodney is 8 but $lucky is 3. A Cheese object may have an age() method that lets you determine how long to stow $cheddar so that it becomes sharp; in other words, age() may be an accessor in one class but not in another:
# how old is the cat? my $years = $zeppie->age(); # store the cheese in the warehouse for six months $cheese->age();
I would lose the code and change the sentence to
A Cheese object may have an age() method that stores the cheese in the warehouse for six months; in other words, age() may be an accessor in one class but a mutator in another.


Comment on Re^4: Modern Perl: The Book: The Draft
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2015-07-31 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (281 votes), past polls