Re: the file slurping is not working

2009-06-10 Thread Smylers
Tom Christiansen writes: Larry wrote: But we're trying very hard to get rid of most such special cases in Perl 6. Usually we can get the recommended Perl 6 code to just DWYM as a fallout of the general semantics, Oh. You mean like for directories containing a file whose name is the

Re: the file slurping is not working

2009-06-05 Thread Carl Mäsak
Aruna (): I tested the below code on parrot-1.1.0 and it read all the lines in the file and tested same code on the latest git update (4th June 2009), it outputs only the first line. That's what C$file.get does -- it gives you one line per default. You want C$file.lines. // Carl

Re: the file slurping is not working

2009-06-05 Thread Aruna Goke
Carl Mäsak wrote: Aruna (): I tested the below code on parrot-1.1.0 and it read all the lines in the file and tested same code on the latest git update (4th June 2009), it outputs only the first line. That's what C$file.get does -- it gives you one line per default. You want C$file.lines. //

Re: the file slurping is not working

2009-06-05 Thread Daniel Carrera
Carl Mäsak wrote: Aruna (): I tested the below code on parrot-1.1.0 and it read all the lines in the file and tested same code on the latest git update (4th June 2009), it outputs only the first line. That's what C$file.get does -- it gives you one line per default. You want C$file.lines.

Re: the file slurping is not working

2009-06-05 Thread Leon Timmermans
Then why is it that .get works fine for $*IN? while $*IN.get - $line {        say $line } Because you're using a while loop instead of a for loop ;-) Leon

Re: the file slurping is not working

2009-06-05 Thread Daniel Carrera
Leon Timmermans wrote: Then why is it that .get works fine for $*IN? while $*IN.get - $line { say $line } Because you're using a while loop instead of a for loop ;-) Worse. The code I wrote has a subtle but horrible error. The condition will fail as soon as you hit a blank line!!

Re: the file slurping is not working

2009-06-05 Thread Carl Mäsak
Daniel (), Leon (), Daniel (): Then why is it that .get works fine for $*IN? while $*IN.get - $line {       say $line } Because you're using a while loop instead of a for loop ;-) Worse. The code I wrote has a subtle but horrible error. The condition will fail as soon as you hit a blank