Skip to content

Commit

Permalink
fix doc about filter subroutines' $_[0]
Browse files Browse the repository at this point in the history
Filter subroutines established by an @inc callback have always received
a numeric zero as their first argument, not a referencet to the sub
as documented.  Fixes [perl #115754].
  • Loading branch information
Zefram committed Dec 12, 2017
1 parent dd9e86b commit 0165f7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pod/perlfunc.pod
Original file line number Diff line number Diff line change
Expand Up @@ -6507,11 +6507,12 @@ subroutine will be called to act as a simple source filter, with the
line as read in L<C<$_>|perlvar/$_>.
Again, return 1 for each valid line, and 0 after all lines have been
returned.
For historical reasons the subroutine will receive a meaningless argument
(in fact always the numeric value zero) as C<$_[0]>.

=item 4

Optional state for the subroutine. The state is passed in as C<$_[1]>. A
reference to the subroutine itself is passed in as C<$_[0]>.
Optional state for the subroutine. The state is passed in as C<$_[1]>.

=back

Expand Down

0 comments on commit 0165f7b

Please sign in to comment.