September 2017
Beginner
402 pages
9h 52m
English
The -n command-line option creates a loop so that the program is executed once for every line of the text submitted to the input of the program.
It may be, for example, a one-line utility that prints the first letter of the strings from the STDIN input:
perl6 -n -e'print $_.substr(0, 1)' < file.txt
It will print the line composed from the first characters of the lines in file.txt.
Read now
Unlock full access