LN - Get
$*ARGFILES with line numbers via
perl -wlnE 'say "$.:$_"; close ARGV if eof' foo bar # Perl
raku -MLN -ne 'say "$*LN:$_"' foo bar # Raku
$ echo -e "a\nb\nc" > foo
$ echo -e "d\ne" > bar
$ raku -MLN -ne 'say "$*LN:$_"' foo bar
$ raku -ne 'use LN "no-reset"; say "$*LN:$_"' foo bar
.ln method containing current line number of the current handle
(or total line number if
'no-reset' option was passed to
use). For ease
of access to that method
$*LN dynamic variable containing its value is
It's been known to fail with versions like Raku 2020.01. Use 2020.02
at least for this.
Contains same value as
which is a method exported by
that gives the current line number of the handle.
By default, the line number will get reset on each new file in
If you wish it to not reset, pass
"no-reset" positional argument to the
use LN 'no-reset';
IO::CatHandle::AutoLines role, for you to use, if needed.
Fork this module on GitHub:
To report bugs or request features, please use
Zoffix Znet (http://perl6.party/)
Currently maintained by the Raku community.
You can use and distribute this module under the terms of the
The Artistic License 2.0. See the
LICENSE file included in this
distribution for complete details.
META6.json file of this distribution may be distributed and modified
without restrictions or attribution.