Skip to content

Comment on OOP Before OOP with Simulaparent

Comments

It doesn't have $this or $self. It has @_, which predates the OO that went into Perl.

Sorry, just getting back to this.

Yeah, it has @_, and in the Perl object model, the first entry in the @_ array is a reference to the object, which is almost always called $self.

Anyway, what people name the reference doesn't matter. The point is that it functions like 'this' and 'self' do in other languages, and it is very much required in object methods (which differ from normal subs in that they are passed that first argument automatically).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.