Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Getting Confused with the '->' operator

by charnos (Friar)
on Oct 01, 2002 at 13:34 UTC ( [id://201998]=note: print w/replies, xml ) Need Help??


in reply to Re: Getting Confused with the '->' operator
in thread Getting Confused with the '->' operator

You are right, it does appear to be plain weird. It should evaluate differently than The_Don expected, with the -> operators operating left to right, so you did read it correctly. BrowserUK made a note about the Java APIs working this way, perhaps name(),job(),wife(), and (presumably)fav_food() all return the object that called it, that much is not clear.
Personally, when writing classes I tend to have my mutators (set()s) return nothing, making a clear distinction between accessors and mutators (except in certain circumstances).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found