File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -416,8 +416,17 @@ Currently no obvious equivalent.
416
416
417
417
= item $.
418
418
419
- The current line number is returned by the C < .ins > method on the appropriate
420
- filehandle. E. g. C < $*IN.ins > .
419
+ No direct replacement exists. For L < IO::Path > types L < IO::Handle > types,
420
+ use L < kv > method on the L < Seq > returned from L < lines > to return indexes as well
421
+ as lines. The numbering will start from zero, but it'll be there.
422
+
423
+ For L < IO::CatHandle > types
424
+ (of which L « C < $*ARGFILES > |/language/variables#index-entry-%24%2AARGFILES» is
425
+ one), you can use L « C < on-switch > |/type/IO::CatHandle#method_on-switch» hook
426
+ to reset line number on handle switch, and increment it manually.
427
+ See also L « C < IO::CatHandle::AutoLines > |https://modules.perl6.org/repo/IO::CatHandle::AutoLines»
428
+ and L « C < LN > |https://modules.perl6.org/repo/LN» modules that simplify this
429
+ operation.
421
430
422
431
= item $INPUT_RECORD_SEPARATOR
423
432
You can’t perform that action at this time.
0 commit comments