Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Calling multi functions in a single statement

by Eliya (Vicar)
on Apr 19, 2012 at 12:54 UTC ( #965943=note: print w/replies, xml ) Need Help??

in reply to Calling multi functions in a single statement

So will $logviewer->get_log_records()->XML_file(); just call both the functions

The first method is being called on an object instance of type CCI::LogViewer, and once it has returned, the second method will be called on whatever object has been returned by the first method (could be an object of a different type (i.e. I haven't checked what it returns)).

Replies are listed 'Best First'.
Re^2: Calling multi functions in a single statement
by akagrawal3 (Beadle) on Apr 20, 2012 at 05:06 UTC
    That sounds good. But from what you said I believe that there should be more than one XML_file subroutine so that once an object is returned by get_log_records() it could decide on which Package it should call XML_file(). Now if that is true, I found that the subroutine XML_file is only in one package and not in any other. So does that make any sense in executing  $logviewer->get_log_records()->XML_file(); . It could have rather just been written as
    $logviewer->get_log_records(); $logviewer->XML_file();
      Just because XML_file is in the same class as get_log_records doesn't mean the two statements are equivalent. Perhaps they are. But that depends on what get_log_records returns. And it only depends on what get_log_records returns.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://965943]
[Tanktalus]: choroba: do I have to move? :)
Discipulus has too much roots in a 2770 yo town
[marioroy]: I want a job after completing MCE in about a week. But feel that I've moved to the wrong place.
[choroba]: I fear so. We have offices in Prague, Brno, Saigon and San Francisco.
[Discipulus]: choroba if let your company to hire Tanktalus and marioroy ... what a big fishing!
[Discipulus]: i choice prague!!
[choroba]: 1200 years is enough :-)
[marioroy]: Lady_Aleena my $ans = qx! find . -name "*.pl" -exec ls -l {} \\; !;
[Tanktalus]: My basic problem right now is that if I were willing to move, I could be back in Toronto with a pay raise. We have a number of reasons for not wanting to do that.
[marioroy]: I had to backslash the backslash inside qx.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-04-23 20:09 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.