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.
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: What does the SHIFT bit do in a constructor
by davorg
in thread What does the SHIFT bit do in a constructor
by Fian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |