Skip to content

Commit

Permalink
Fix docs for $. replacements
Browse files Browse the repository at this point in the history
Fixes #401
  • Loading branch information
zoffixznet committed Jun 5, 2017
1 parent 3499fd9 commit 9673377
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions doc/Language/5to6-perlvar.pod6
Expand Up @@ -416,8 +416,17 @@ Currently no obvious equivalent.
=item $.
The current line number is returned by the C<.ins> method on the appropriate
filehandle. E. g. C<$*IN.ins>.
No direct replacement exists. For L<IO::Path> types L<IO::Handle> types,
use L<kv> method on the L<Seq> returned from L<lines> to return indexes as well
as lines. The numbering will start from zero, but it'll be there.
For L<IO::CatHandle> types
(of which L«C<$*ARGFILES>|/language/variables#index-entry-%24%2AARGFILES» is
one), you can use L«C<on-switch>|/type/IO::CatHandle#method_on-switch» hook
to reset line number on handle switch, and increment it manually.
See also L«C<IO::CatHandle::AutoLines>|https://modules.perl6.org/repo/IO::CatHandle::AutoLines»
and L«C<LN>|https://modules.perl6.org/repo/LN» modules that simplify this
operation.
=item $INPUT_RECORD_SEPARATOR
Expand Down

0 comments on commit 9673377

Please sign in to comment.