goutamram has asked for the wisdom of the Perl Monks concerning the following question:

Hi .. I am a newbie to Perl.. What is the difference between these two ways of calling a function ? 1. MainFile::FuncName($hashref,$gui); 2. my $ret = $MainFileObj->FuncName($hashref,$gui); Also in the first one, how can I get the return value ? is it possible ?

Replies are listed 'Best First'.
Re: doubt in object oriented
by ikegami (Patriarch) on Feb 18, 2011 at 22:02 UTC

    In the first, you have a function call. In the second, you have a method call.

    Method calls follow inheritance. Method calls pass the class or object on which the method was called as the first parameter.

    Values are returned to the caller identically in both cases. Returned values are obtained by the caller identically in both cases.

Re: doubt in object oriented
by ciderpunx (Vicar) on Feb 18, 2011 at 21:59 UTC
    Tell you what, what do you think are the differences? What have you tried to get the return value? What do you think might work?
    --
    Linux, perl, punk rock, cider: charlieharvey.org.uk.