> > One of my many RFCs will include a proposal for a $SELF variable along
> > those lines.
>
> Why not allow for the choice of the name of self, perhaps through a pragma?
>
> use self => 'self';
> use self => 'this';
>
> or something along those lines -- since it's currently up to the devleoper
> anyway. Somethign about a capitolized SELF is unappealing to my eyes.
$ME will be like other magic variables, so you can always write:
sub self {$ME}
sub this {$ME}
sub I {$ME}
sub one {$ME}
sub obj {$ME}
sub TheObjectThatThisMethodWasInvokedOn { $ME }
# and later
sub shout {
self->set_name(uc this->get_name);
}
Of course, these particular subroutines might be a good (and easy)
target for inlining optimization.
Damian