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

Look what you can do at the terminal! A collection of Perl6 one liners

Results 16 Perl6-One-Liners issues
Sort by recently updated
recently updated
newest added

I went through the guide, spotted some bugs. This fixes them.

> Remove all consecutive blank lines, leaving just one > >` >perl6 -e '$*ARGFILES.slurp.subst(/\n+/, "\n\n", :g).say' example.txt` Actually, the code above literally says to take any single "\n" and replace...

$ perl6 -ne 'say "{++$} $_"' /etc/fstab 1 1 # 1 # /etc/fstab 1 # Created by anaconda on Sat Oct 21 20:51:39 2017 1 # 1 # Accessible filesystems,...

the example for N-spacing a file is titled "e.g. quadruple space", but the example below that uses "\n" x 4, which will end up with each line followed by 4...

it's grabbing only the contents of the very first line, then it joins all the words together to one big string and makes a Bag out of it (which is...

since you're printing out the `.sort` of a Set, you'll get a list of pairs that all have `True` as the value consider using `.unique.sort` instead of `.Set.sort` ``` perl6...

``` perl6 -e '(2, 4 ... 100).say' (2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46...

please consider this example for better readability than the `+>(8*$_)` version and not having to `use experimental :pack` like the one using "pack". ``` perl6 -e 'say join ".", 2130706433.polymod(256,...

you're calling .split on an array, which will first stringify the array by inserting single spaces between the lines and then splitting it by "\t". That causes fields from the...

the max of a list of lines is the lexicographically last, for example if there's a single line in the file that starts with a z, it's quite likely to...