Skip to content

Instantly share code, notes, and snippets.

@pmichaud
Last active August 29, 2015 14:07
Show Gist options
  • Save pmichaud/55a0a1543a4fd8a17d7c to your computer and use it in GitHub Desktop.
Save pmichaud/55a0a1543a4fd8a17d7c to your computer and use it in GitHub Desktop.
IO::Handle .ins bug
pmichaud@plum:~/p6/rakudo$ cat ins.p6
my $fh = open("README.md");
for $fh.lines() {
say $fh.ins;
last;
}
pmichaud@plum:~/p6/rakudo$ ./perl6 ins.p6
0
pmichaud@plum:~/p6/rakudo$
@lizmat
Copy link

lizmat commented Oct 12, 2014

my $fh = open("README.md");
my $seen = 10;

for $fh.lines() {
say $fh.ins;
last unless --$seen;

}

It seems to run 1 behind:

$ perl6 pm
0
1
2
3
4
5
6
7
8
9

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