Skip to content

Instantly share code, notes, and snippets.

@Altai-man
Created July 6, 2019 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Altai-man/44aee25611146c96705275a16539c837 to your computer and use it in GitHub Desktop.
Save Altai-man/44aee25611146c96705275a16539c837 to your computer and use it in GitHub Desktop.
use v6;
sub MAIN(:$fmt = '%d ', *@*ARGS) {
my $nl = 1;
for @*ARGS {
for .IO.lines -> $line {
printf($fmt ~ "%s\n", $nl++, $line);
}
}
}
@Altai-man
Copy link
Author

➜  ~ perl6 perl6.pl6 test.lua
1 1
2 2
3 3
4 4
5 5
➜  ~ perl6 perl6.pl6 --fmt='%d    ' test.lua
1    1
2    2
3    3
4    4
5    5
➜  ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment