There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
OK, the easiet way for me to explain this is to show you a line of code that I have at work... $interface->handler($client)->parse($local_file_name); My question, I hope, is trivial... 'Which methods are invoked on which objects?' I have seen examples that piggy-back the '->' operator: Obviosly all the method calls are targeted at the Person object (I mean a job does not have a wife, and we all know that Marge's favorite food is potatoes!) but other times I'll see things like the first line from work where it looks like each call is invoked on the last referenced object. Does it depend on what each of those calls are returning? i.e. a return of undef forces Perl to make the call on the next previously defined object? Or is there some other rule that I am not aware of? I have gone through the Object chapter of Programming Perl, 3rd Edition. Feel free to direct me within that text or on-line for an existing explanation. I may have just missed it as a result of my frustration. the_Don In reply to Getting Confused with the '->' operator by the_Don
|
|