develooper Front page | perl.perl5.porters | Postings from November 2005

[perl #31400] $obj->$coderef(...) undocumented

From:
Steve Peters via RT
Date:
November 27, 2005 19:01
Subject:
[perl #31400] $obj->$coderef(...) undocumented
Message ID:
rt-3.0.11-31400-124911.17.6129549581143@perl.org
> [mjd@plover.com - Wed Sep 08 20:37:13 2004]:
> 
> 
> Mark Jason Dominus:
> > Everyone knows about
> > 
> >         $method_name = "some_method";
> >         $object->$method_name(...);
> > 
> > but this is much less well-known:
> > 
> >         $method_ref = \&some_method;
> >         $object->$method_ref(...);
> > 
> > and in fact I could not find it documented anywhere.
> > 
> > It is mentioned in passing in 'perltooc', but I think that is all.
> 
> It turns out that it is mentioned in perlop, in the section on the ->
> operator:
> 
>        ...the right side is a method name or a simple scalar variable
>        containing either the method name or a subroutine reference....
>        See perlobj.
> 
> I haven't found the promised discussion in 'perlobj'.

A mention of this fact added to perlobj.pod with change #26218.




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