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

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

From:
perlbug-followup
Date:
December 16, 2008 05:15
Subject:
[perl #61392] Method call documentation in perlobj.pod
Message ID:
rt-3.6.HEAD-26243-1229402223-570.61392-75-0@perl.org
# New Ticket Created by  ian.goodacre@xtra.co.nz 
# Please include the string:  [perl #61392]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61392 >


Following brief discussion on PerlMonks
(http://www.perlmonks.org/?node_id=730166)
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>
      
      
Regards,
Ian Goodacre



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