Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: [SOLVED]: Trying to understand method calling in OOP

by Anonymous Monk
on May 08, 2018 at 11:59 UTC ( #1214207=note: print w/replies, xml ) Need Help??


in reply to [SOLVED]: Trying to understand method calling in OOP

shift removes the first variable from the parameter-list, which is then assigned to the (arbitrarily-named) local variable self to provide access to the object. Many object programming languages use the technique of "a hidden first-parameter." Perl just does so explicitly.
  • Comment on Re: [SOLVED]: Trying to understand method calling in OOP

Replies are listed 'Best First'.
Re^2: [SOLVED]: Trying to understand method calling in OOP
by Your Mother (Bishop) on May 08, 2018 at 17:25 UTC

    Please, be correct, and thorough, if you're going to reply. It's so much easier to give a link to a POD page than regurgitate a fragment of it; shift. At least you stopped describing it before errors crept in.

    local variable self to provide access to the object

    Not a record but three, we'll call them half, errors in a sentence is still a pretty good turn at bat. It's not a local variable. It's not a variable (like $self) but a bareword (self). It might be the class and not an object.

    Given the idioms and the MO I have to assume you are sundialsvc4. Giving half right, or in this case, 25ish% right answers to a question no one asked, helps no one and muddies the water. It harms and diminishes the monastery. Why not take a break? Come back in a few months with a new user name, reset the acrimony, as a supplicant and fan of the language instead of an expert aphorism machine stepping on threads and riding coat-tails. If you cannot bring yourself to leave, please try to change your participation.

      If the post was indeed made by the sundialsvc4, as you suggest, that leads us to two more unsolved mysteries:

      • Was it done deliberately (to avoid the obligatory "seven" down-votes) or accidentally ("the system logged me out")?
      • Why is it when posting anonymously, he uses "these double quotes" yet when posting as himself he uses “these double quotes”? Could it be somehow related to this?

      More mysteries to keep me up at night.

      Update: Aha, found a smoking gun that indicates at least some of these recent anonymous posts were deliberate! This node uses “these double quotes” and was done accidentally as indicated by the follow up. Therefore, recent "anonymous" posts used "these double quotes" in a childish attempt to disguise the true author.

        Oh lord, please ...

        ... is there any chance to restrict the feeding to simple and short corrections to protect the unaware?

        Is it really important which incarnation of which prophet posted bull as long as it was countered?

        I mean "sundialtology" might be fun at first, but at some point most posts here will become "bla++" exegesis and define the perception of this board.

        Please! :)

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2019-07-18 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?