Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
t; Hi All, > > When reading a text file > https://docs.perl6.org/routine/lines > seems pretty straight forward. > > Question: How do I tell when I when I have > reached the EOF (End Of File)? > > Many thanks, &

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
0/9/18 1:02 AM, ToddAndMargo via perl6-users wrote: > > Hi All, > > > > When reading a text file > > https://docs.perl6.org/routine/lines > > seems pretty straight forward. > > > > Question: How

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
iterates the Seq, printing all the lines. The second call to .lines() returns nothing because you're now at eof, no more lines. Note the Seq that .lines returns itself is lazy.  It doesn't (necessarily) have all the lines, just the capability to get them. As you iterate the Seq, it pulls in all t

Re: eof ?

2018-10-09 Thread Brad Gilbert
text file > > > https://docs.perl6.org/routine/lines > > > seems pretty straight forward. > > > > > > Question: How do I tell when I when I have > > > reached the EOF (End Of File)? > > > > > > Many t

Re: eof ?

2018-10-09 Thread Brad Gilbert
On Tue, Oct 9, 2018 at 8:31 AM Curt Tilmes wrote: > > On Tue, Oct 9, 2018 at 9:27 AM Laurent Rosenfeld via perl6-users > wrote: >> >> This: >> my $f = $fh.lines; >> will slurp all the lines into $f (but you can still access the individual >> items with something like $f[4]). > > > Is that

Re: eof ?

2018-10-09 Thread Laurent Rosenfeld via perl6-users
Yes, you're right, it is a Seq. I was trying to be pedagogical, but probably wasn't very accurate. It is a Seq, and the "slurping" will be lazy. Le mar. 9 oct. 2018 à 15:30, Curt Tilmes a écrit : > On Tue, Oct 9, 2018 at 9:27 AM Laurent Rosenfeld via perl6-users < > perl6-us...@perl.org>

Re: eof ?

2018-10-09 Thread Curt Tilmes
On Tue, Oct 9, 2018 at 9:27 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > This: > my $f = $fh.lines; > will slurp all the lines into $f (but you can still access the individual > items with something like $f[4]). > Is that true? I supposed that it would hold the Seq as a

Re: eof ?

2018-10-09 Thread Laurent Rosenfeld via perl6-users
ddAndMargo via perl6-users wrote: > > > Hi All, > > > > > > When reading a text file > > > https://docs.perl6.org/routine/lines > > > seems pretty straight forward. > > > > > > Question: How do I tell when

Re: eof ?

2018-10-09 Thread Curt Tilmes
es. The second call to .lines() returns nothing because you're now at eof, no more lines. Note the Seq that .lines returns itself is lazy. It doesn't (necessarily) have all the lines, just the capability to get them. As you iterate the Seq, it pulls in all the lines. Curt

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
t; Hi All, > > When reading a text file > https://docs.perl6.org/routine/lines > seems pretty straight forward. > > Question:  How do I tell when I when I have > reached the EOF (End Of File)? > > Many thanks, > -T Plea

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
How do I tell when I when I have     reached the EOF (End Of File)?     Many thanks,     -T On 10/9/18 4:38 AM, Laurent Rosenfeld via perl6-users wrote: The eof method of the IO::Handle class returns True if you exhausted the contents of the handle, but you generally don't need to use that,

Re: eof ?

2018-10-09 Thread Fernando Santagata
https://docs.perl6.org/routine/lines > > seems pretty straight forward. > > > > Question: How do I tell when I when I have > > reached the EOF (End Of File)? > > > > Many thanks, > > -T > > Please expand the question to include `read` and `readchars`. > -- Fernando Santagata

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
Le mar. 9 oct. 2018 à 10:03, ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> a écrit : Hi All, When reading a text file https://docs.perl6.org/routine/lines seems pretty straight forward. Question: How do I tell when I when I have reached the EO

Re: eof ?

2018-10-09 Thread Laurent Rosenfeld via perl6-users
The eof method of the IO::Handle class returns True if you exhausted the contents of the handle, but you generally don't need to use that, since something like: for 'input.txt'.IO.lines -> $line { # Do something with $line } will gracefully handle ends of files for you without you hav

Re: eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/9/18 1:02 AM, ToddAndMargo via perl6-users wrote: Hi All, When reading a text file     https://docs.perl6.org/routine/lines seems pretty straight forward. Question:  How do I tell when I when I have reached the EOF (End Of File)? Many thanks, -T Please expand the question to include

eof ?

2018-10-09 Thread ToddAndMargo via perl6-users
Hi All, When reading a text file https://docs.perl6.org/routine/lines seems pretty straight forward. Question: How do I tell when I when I have reached the EOF (End Of File)? Many thanks, -T

[perl #131393] [JVM] When reading from stdin, eof is not respected

2018-03-05 Thread Christian Bartolomaeus via RT
On Sun, 28 May 2017 13:09:18 -0700, barto...@gmx.de wrote: > Currently rakudo on JVM does not respect eof when reading from stdin. > > bartolin_ r: .say for lines() > camelia rakudo-moar 094e77: OUTPUT: «»Wann treffen wir drei > wieder zusamm?«␤ »Um die siebente Stund‘,

[perl #130086] [BUG] multiple eof-s support on $*IN

2018-01-20 Thread Zoffix Znet via RT
On Sun, 13 Nov 2016 08:07:34 -0800, vivids...@gmail.com wrote: > Hello > > It is expected to be able to pass multiple eof-s (by pressing Ctrl+D). > > working p5 script: multiple-eof.pl > and two variants of p6 scripts, which falls to endless loop after > first "eof&quo

[perl #130086] [BUG] multiple eof-s support on $*IN

2018-01-20 Thread Zoffix Znet via RT
On Sun, 13 Nov 2016 08:07:34 -0800, vivids...@gmail.com wrote: > Hello > > It is expected to be able to pass multiple eof-s (by pressing Ctrl+D). > > working p5 script: multiple-eof.pl > and two variants of p6 scripts, which falls to endless loop after > first "eof&quo

[perl #131393] [JVM] When reading from stdin, eof is not respected

2017-05-28 Thread via RT
# New Ticket Created by Christian Bartolomaeus # Please include the string: [perl #131393] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131393 > Currently rakudo on JVM does not respect eof when reading from st

[perl #130086] [BUG] multiple eof-s support on $*IN

2016-11-13 Thread via RT
# New Ticket Created by vividsnow # Please include the string: [perl #130086] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130086 > Hello It is expected to be able to pass multiple eof-s (by pressing Ctrl+D). working

[perl #127423] [BUG] EOF check in MoarVM breaks process substitution and opening of devices

2016-01-29 Thread via RT
# New Ticket Created by Vittore SCOLARI # Please include the string: [perl #127423] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=127423 > Typing the following on the command line: perl6 -e 'say @*ARGS[0].IO.open(:r).lines'

[perl #125440] [BUG] Indirect object colon doesn't parse just before EOF in Rakudo

2015-06-19 Thread Carl Mäsak
: OUTPUT«42␤» TimToady masak: it's just an EOF anomaly moritz m: say abs -42:; camelia rakudo-moar f1fa64: OUTPUT«42␤» moritz m: say abs -42: camelia rakudo-moar f1fa64: OUTPUT«===SORRY!=== Error while compiling /tmp/V2UzSPiN8k␤Confused [...] * masak submits rakudobug

[perl #66050] Can't exit REPL with exit; or EOF

2010-08-11 Thread Will Coleda via RT
On Fri Jun 26 01:42:55 2009, moritz wrote: On Thu Jun 25 08:54:51 2009, pmichaud wrote: This was caused by a bug in Parrot; the problem in Parrot seems to have been resolved and now EOF appears to work again. Right, but exit; still doesn't. Closing ticket, thanks! ... and re

[perl #66050] Can't exit REPL with exit; or EOF

2009-06-25 Thread Patrick R. Michaud via RT
This was caused by a bug in Parrot; the problem in Parrot seems to have been resolved and now EOF appears to work again. Closing ticket, thanks! Pm

[perl #66050] Can't exit REPL with exit; or EOF

2009-05-27 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #66050] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=66050 On the REPL, neither `exit;' nor sending an EOF (view Ctrl+D on Unix) terminate

Re: [perl #61224] .eof returns false if last read call read the last byte of the file, but not beyond

2008-12-12 Thread Joshua Juran
. Any read ahead can be a bit expensive. I experimented with a quick patch to use 'peek' in the test for EOF in Parrot, just to see what would happen... it broke a large quantity of code (probably because all the code is expecting the old behavior of the EOF test, or possibly a bug in 'peek

[perl #61224] .eof returns false if last read call read the last byte of the file, but not beyond

2008-12-09 Thread via RT
# New Ticket Created by Jonathan Worthington # Please include the string: [perl #61224] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61224 Hi, It seems that the .eof() method on file handles can sometimes return

[perl #46835] [TODO] [Pir] Test reading long chunks, eof, and across newlines

2007-10-24 Thread via RT
# New Ticket Created by Paul Cochrane # Please include the string: [perl #46835] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=46835 In t/pmc/parrotio.t there is the todo item: # TODO test reading long chunks, eof

[perl #40776] [TODO] Tcl - test eof condition in t/cmd_eof.t

2006-11-09 Thread via RT
# New Ticket Created by Paul Cochrane # Please include the string: [perl #40776] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40776 Create test files and read from them, testing the eof condition in languages/tcl/t

Re: [perl #33171] Error When Reading Past EOF

2005-02-03 Thread Matt Diephouse
Leopold Toetsch [EMAIL PROTECTED] wrote: Matt Diephouse [EMAIL PROTECTED] wrote: That still results in in file (unknown) near line -1 being printed as part of the error message, so I'm leaving this ticket open. (It annoys me.) *g* I've changed now the policy for including source

Re: [perl #33171] Error When Reading Past EOF

2005-02-03 Thread Leopold Toetsch
Matt Diephouse [EMAIL PROTECTED] wrote: That still results in in file (unknown) near line -1 being printed as part of the error message, so I'm leaving this ticket open. (It annoys me.) *g* I've changed now the policy for including source line information. Unless -O is given file and line

Re: [perl #33171] Error When Reading Past EOF

2005-02-02 Thread Matt Diephouse
Leopold Toetsch [EMAIL PROTECTED] wrote: Matt Diephouse [EMAIL PROTECTED] wrote: It also changes the function used to raise the exception from real_exception to internal_exception We've to change a lot of internal_exceptions to real ones eventually and print better diagnostics, so no.

Re: [perl #33171] Error When Reading Past EOF

2005-02-01 Thread Leopold Toetsch
Matt Diephouse [EMAIL PROTECTED] wrote: The attached patch changes the error to: Cannot read line from empty filehandle Done. It also changes the function used to raise the exception from real_exception to internal_exception We've to change a lot of internal_exceptions to real ones

Re: [perl #33171] Error When Reading Past EOF

2005-01-31 Thread Matt Diephouse
=33171 Reading past the EOF in PIR results in the following error:    File not found            in file '(unknown file)' near line -1 That's less than helpful. Or at least less helpful than it could be. A better error would be really nice. The attached patch changes the error to:   Cannot

[perl #33171] IMCC Error When Reading Past EOF

2004-12-23 Thread via RT
# New Ticket Created by Matt Diephouse # Please include the string: [perl #33171] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=33171 Reading past the EOF in PIR results in the following error: File not found

eof opcode

2004-11-24 Thread brian wheeler
I noticed a hole in the io.ops where the PIO stuff wasn't covered. This patch creates an eof opcode which checks for end of file. Brian Wheeler [EMAIL PROTECTED] cvs diff: Diffing . cvs diff: Diffing ops Index: ops/io.ops === RCS

Re: eof opcode

2004-11-24 Thread Leopold Toetsch
Brian Wheeler [EMAIL PROTECTED] wrote: I noticed a hole in the io.ops where the PIO stuff wasn't covered. This patch creates an eof opcode which checks for end of file. Please just use the eof method of the PIO object: $I0 = $P0.eof() leo