in reply to What does the SHIFT bit do in a constructor

When you call a class method (for example my $obj = MYObject->new), the class name is automatically passed in as the first element of @_. A similar thing happens when you call object methods, the object is passed in as the first element of @_.

For more details see perlboot, perltoot, perlobj and Damian Conway's book Object Oriented Perl.

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

  • Comment on Re: What does the SHIFT bit do in a constructor