On Thu, 24 Aug 2000 13:27:01 -0700, Nathan Wiger wrote:
>It's a pain if you want to support both function-oriented and
>object-oriented calling forms, as CGI.pm does. For example, you can use
>both of these:
>
> print header;
> print $r->header;
>
>with CGI.pm. Now you need a self_of_default special method, since
>sometimes $_[0] has a class ref and sometimes it has the first method
>argument.
Don' forget to mention that if the sub can also be used as a class
method, the is NO WAY to distinguish between
CGI->header
and
header("CGI")
Hence, with some values for the functional argument, the detection
mechanism is unreliable.
Either $ME or self() (which, BTW, is more related to caller() than to
ref()) is 100% reliable.
--
Bart.
- RFC 152 (v1) Replace $self in @_ with self() builtin (... Perl6 RFC Librarian
- Re: RFC 152 (v1) Replace $self in @_ with self() ... Hildo Biersma
- Re: RFC 152 (v1) Replace $self in @_ with sel... Dave Rolsky
- Re: RFC 152 (v1) Replace $self in @_ with sel... Nathan Wiger
- Re: RFC 152 (v1) Replace $self in @_ with... Randal L. Schwartz
- Re: RFC 152 (v1) Replace $self in @_ with self() ... Tom Christiansen
- Re: RFC 152 (v1) Replace $self in @_ with sel... Nathan Wiger
- Re: RFC 152 (v1) Replace $self in @_ with... Bart Lateur
- Re: RFC 152 (v1) Replace $self in @_ with... Tom Christiansen
- Re: RFC 152 (v1) Replace $self in @_ ... Nathan Wiger
- Re: RFC 152 (v1) Replace $self in @_ with self() ... Michael Maraist
- Re: RFC 152 (v1) Replace $self in @_ with self() ... Damian Conway
- Re: RFC 152 (v1) Replace $self in @_ with sel... Nathan Wiger
- Re: RFC 152 (v1) Replace $self in @_ with... Jonathan Scott Duff
- RE: RFC 152 (v1) Replace $self in @_ with self() ... Myers, Dirk
