Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
3
Task/Input-loop/Perl-6/input-loop-1.pl6
Normal file
3
Task/Input-loop/Perl-6/input-loop-1.pl6
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for "filename.txt".IO.lines -> $line {
|
||||
...
|
||||
}
|
||||
3
Task/Input-loop/Perl-6/input-loop-2.pl6
Normal file
3
Task/Input-loop/Perl-6/input-loop-2.pl6
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for $*IN.lines -> $line {
|
||||
...
|
||||
}
|
||||
3
Task/Input-loop/Perl-6/input-loop-3.pl6
Normal file
3
Task/Input-loop/Perl-6/input-loop-3.pl6
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for pipe("find -iname '*.txt'").lines -> $filename {
|
||||
...
|
||||
}
|
||||
3
Task/Input-loop/Perl-6/input-loop-4.pl6
Normal file
3
Task/Input-loop/Perl-6/input-loop-4.pl6
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for pipe("find -iname '*.txt' -print0", :nl«\0»).lines -> $filename {
|
||||
...
|
||||
}
|
||||
3
Task/Input-loop/Perl-6/input-loop-5.pl6
Normal file
3
Task/Input-loop/Perl-6/input-loop-5.pl6
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for "filename.txt".IO.words -> $word {
|
||||
...
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
my $handle = open "filename.txt"; # $handle could be $*IN to read from standard input
|
||||
|
||||
for $handle.lines -> $line { # iterates the lines of the $handle
|
||||
|
||||
# line endings are automatically stripped
|
||||
|
||||
for $line.words -> $word { # iterates the words of the line
|
||||
# are considered words groups of non-whitespace characters
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue