Perl6-One-Liners icon indicating copy to clipboard operation
Perl6-One-Liners copied to clipboard

examples that combine -ne and $*ARGFILES.lines are wrong

Open timo opened this issue 8 years ago • 0 comments

this concerns the second example of "number all lines in a file", "number all lines but print line numbers only for non-empty lines"

calling $*ARGFILES.lines will immediately eat up the rest of the incoming data, and the $_ will just contain the very first line. so what you end up with is first the whole rest of the file with line numbers in one line followed by the first line's content.

timo avatar Oct 28 '17 01:10 timo