Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

doubt in object oriented

by goutamram (Initiate)
on Feb 18, 2011 at 21:30 UTC ( [id://888994]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 23:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found