Created
May 2, 2016 22:36
-
-
Save nd3i/03750ed3a67a2c0368773c127d165e6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6; | |
| sub MAIN (:$sep = "\t", :$min = 0) { | |
| my ($lines, $words, $chars) = 0 xx 3; | |
| for lines() -> $l { | |
| $lines += 1; | |
| $chars += $l.chars + 1; | |
| $words += $l.subst(/<-alpha -space>/,'',:g).words.grep(*.chars >= $min); | |
| } | |
| say ($lines, $words, $chars).join($sep); | |
| } |
Author
Try this:
sub MAIN (*@files, :$sep = "\t", :$min = 0) {
@*ARGS = @files;
# ....rest as before
}
Or more concisely, at the risk of confusing readers:
sub MAIN (*@*ARGS, :$sep = "\t", :$min = 0) {
# ....rest as before
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the complete message: