develooper Front page | perl.perl5.porters | Postings from December 2008

[perl #61392] Method call documentation in perlobj.pod

December 16, 2008 05:15
[perl #61392] Method call documentation in perlobj.pod
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #61392]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Following brief discussion on PerlMonks
I submit the following patch to perlobj.pod
for your consideration.

$ diff -u /usr/lib/perl5/5.8.8/pod/perlobj.pod ./perlobj.pod
--- /usr/lib/perl5/5.8.8/pod/perlobj.pod        2008-09-18 
05:40:09.000000000 +1200
+++ ./perlobj.pod       2008-12-16 17:12:27.000000000 +1300
@@ -312,6 +312,19 @@
 scalar variable containing either the method name or a subroutine
  reference can also be used.
   +If the right side of the arrow is a scalar containing a reference
   +to a subroutine then this is equivalent to calling the referenced
   +subroutine directly with the class name or object on the left side
   +of the arrow as its first argument. No lookup is done and there is
   +no requirement that the subroutine be defined in any package related
   +to the class name or object on the left side of the arrow.
   +For example, the following calls to $display are equivalent:
   +    my $display = sub { my $self = shift; ... };
   +    $fred->$display("Height", "Weight");
   +    $display->($fred, "Height", "Weight");
    =head2 Indirect Object Syntax
     X<indirect object syntax> X<invocation, indirect> X<indirect>
Ian Goodacre Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About