develooper Front page | perl.perl6.language.objects | Postings from August 2000

Re: $ME in a method called as a subroutine

Thread Previous | Thread Next
From:
Piers Cawley
Date:
August 23, 2000 01:25
Subject:
Re: $ME in a method called as a subroutine
Message ID:
m1em3gs800.fsf@rt158.private.realtime.co.uk
Markus Peter <warp@spin.de> writes:

> --On 22.08.2000 18:24 Uhr +0000 David L. Nicol wrote:
> 
> >
> > Regardless of what its called, in a method called as a subroutine,
> > the variable could refer to the last instance of this kind of object
> > used by this thread.
> 
> Hmm.... Does that mean if I once all $obj->method() and then afterwards
> somewhere else obj::method() then $ME or whatever it is called still holds
> $obj ? If yes, why? I can imagine _some_ cases where that's useful, 
> especially if someone is sloppily mixing procedural and object oriented 
> programming, but I can also imagine many more cases where it adds 
> confusion.
> 
> In my opinion the contents of $ME should allow to determine wether it was 
> called as a procedure or as a method, the easiest way to do that is undef 
> for procedure, object for method and classname for class methods.

Procedure reference for a procedure call please. It makes for some
nice wins with anonymous subroutines...

-- 
Piers


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About