Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lines() in rakudo loops when input comes from a redirect #3373

Closed
p6rt opened this issue Apr 23, 2014 · 5 comments
Closed

lines() in rakudo loops when input comes from a redirect #3373

p6rt opened this issue Apr 23, 2014 · 5 comments
Labels
MoarVM Related to Rakudo-MoarVM

Comments

@p6rt
Copy link

p6rt commented Apr 23, 2014

Migrated from rt.perl.org#121720 (status was 'resolved')

Searchable as RT121720$

@p6rt
Copy link
Author

p6rt commented Apr 23, 2014

From @moritz

$ ./perl6-m --version
This is perl6 version 2014.04-86-gf724dd5 built on MoarVM version
2014.04-28-geadd2c8$
$ echo 'foo' > input
$ cat input | ./perl6-m -e '.say for lines()' # as expected
foo
$ ./perl6-m -e '.say for lines()' < input |head -n 20|wc -l
20

WTF? Supplying the input through a redirect instead of a pipe causes
rakudo-m to ready infintely many empty strings from lines().

@p6rt
Copy link
Author

p6rt commented Apr 23, 2014

From @FROGGS

That shows the problem I think​:

cat input | perl6-m -e 'my $fh = open("-", :r); say $fh.get.defined; say $fh.get.defined'
True
False

perl6-m -e 'my $fh = open("-", :r); say $fh.get.defined; say $fh.get.defined' < input
True
True

@p6rt
Copy link
Author

p6rt commented Apr 23, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 23, 2014

From @FROGGS

Fixed at MoarVM/MoarVM@a109e8d765
NQP/Rakudo got bumped, so this patch is included in rakudo HEAD.

@p6rt
Copy link
Author

p6rt commented Apr 23, 2014

@FROGGS - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 23, 2014
@p6rt p6rt added the MoarVM Related to Rakudo-MoarVM label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MoarVM Related to Rakudo-MoarVM
Projects
None yet
Development

No branches or pull requests

1 participant