Perl6-One-Liners
Perl6-One-Liners copied to clipboard
Look what you can do at the terminal! A collection of Perl6 one liners
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...
since slurp defaults to using $*ARGFILES, you can drop the $*ARGFILES in front.
perl6 -MTest -e 'plan 1;is q:x{perl6 -ce "state %l;.say if ++%l{$_}==2"}, "Syntax OK\n";'
we do a different kind of newline translation nowadays, and also \r\n is now counted as a single grapheme cluster. maybe the code needs changing.
Hopefully the commit messages make the intent of each clear.
In this section, you should probably put somewhere that many of these examples use fields that are specifically tab-separated, as - unless I'm very confused - fields can be separated...