Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [perl #60142] AutoReply: A line-counting program in Rakudo reports one more line than wc

0 views
Skip to first unread message

cma...@gmail.com

unread,
Oct 26, 2008, 3:31:39 PM10/26/08
to perl6-bug...@perl.org
As a funny bonus, Parrot segfaults if the dummy assignment is left out
inside the loop:

$ <README ./perl6 -e 'my $l = 0; while !$*IN.eof { $l++; =$*IN; }; say $l'
Segmentation fault

Carl Mäsak

unread,
Oct 26, 2008, 3:27:26 PM10/26/08
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #60142]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60142 >


Rakudo r32151 contains a bug which makes it "read" a nonexistent blank
line at the end of files.

$ wc README | awk '{ print $1 }'
102

$ <README ./perl6 -e 'my $l = 0; while !$*IN.eof { $l++; my $dummy =
=$*IN; }; say $l'
103

Patrick R. Michaud via RT

unread,
Jun 30, 2009, 9:14:27 PM6/30/09
to perl6-c...@perl.org
On Sun Oct 26 12:27:26 2008, masak wrote:
> Rakudo r32151 contains a bug which makes it "read" a nonexistent blank
> line at the end of files.
>
> $ wc README | awk '{ print $1 }'
> 102
>
> $ <README ./perl6 -e 'my $l = 0; while !$*IN.eof { $l++; my $dummy =
> =$*IN; }; say $l'
> 103

IO.pod:1207 claims that "IO.eof" is gone, to be replaced with
C<IO::Endable>. But I can't seem to find any specification or
documentation on Endable.

So, I'm converting this ticket to a specbug, in hopes that p6l or
someone can sort it out.

If it turns out that IO.eof still exists, then should it continue to
have the Perl 5 behavior of performing a getc/ungetc to check EOF?

Pm


0 new messages