Re: Best way to slurp a file in Perl 6

2005-03-21 Thread Matt Diephouse
Rod Adams <[EMAIL PROTECTED]> wrote: > Larry Wall wrote: > > On Sat, Mar 19, 2005 at 11:03:40PM +1100, Andrew Savige wrote: > > > > : 2) Documentation. > > :Where is the slurp built-in documented? I couldn't find it > > :in any of the Synopses (including Rod Adams' recent S29). > > :In

Re: Best way to slurp a file in Perl 6

2005-03-21 Thread Rod Adams
Larry Wall wrote: On Sat, Mar 19, 2005 at 11:03:40PM +1100, Andrew Savige wrote: : 2) Documentation. :Where is the slurp built-in documented? I couldn't find it :in any of the Synopses (including Rod Adams' recent S29). :In desperation, I googled and found CPAN Perl6::Slurp. The officia

Re: Best way to slurp a file in Perl 6

2005-03-20 Thread Rod Adams
Larry Wall wrote: On Sat, Mar 19, 2005 at 11:03:40PM +1100, Andrew Savige wrote: : 2) Documentation. :Where is the slurp built-in documented? I couldn't find it :in any of the Synopses (including Rod Adams' recent S29). :In desperation, I googled and found CPAN Perl6::Slurp. The officia

Re: Best way to slurp a file in Perl 6

2005-03-19 Thread Larry Wall
On Sat, Mar 19, 2005 at 11:03:40PM +1100, Andrew Savige wrote: : --- Autrijus Tang wrote: : > On Fri, Mar 18, 2005 at 09:35:59PM +1100, Andrew Savige wrote: : > > What is the best way in Perl6/Pugs to slurp a file? : > : > You use the slurp() primitive, implemented as r875. :) : : Thanks. I teste

Re: Best way to slurp a file in Perl 6

2005-03-19 Thread Andrew Savige
--- Autrijus Tang wrote: > On Fri, Mar 18, 2005 at 09:35:59PM +1100, Andrew Savige wrote: > > What is the best way in Perl6/Pugs to slurp a file? > > You use the slurp() primitive, implemented as r875. :) Thanks. I tested these two forms and it's truly lovely: my $x = slurp($fname) err die("slur

Re: Best way to slurp a file in Perl 6

2005-03-18 Thread Autrijus Tang
On Fri, Mar 18, 2005 at 09:35:59PM +1100, Andrew Savige wrote: > What is the best way in Perl6/Pugs to slurp a file? You use the slurp() primitive, implemented as r875. :) Thanks, /Autrijus/ pgpRvJPSFij0S.pgp Description: PGP signature

Best way to slurp a file in Perl 6

2005-03-18 Thread Andrew Savige
>From S04: It is possible to write while =$*IN -> $line {...} But it won't do what you expect, because unary = does a slurp in scalar context, so $line will contain the entire file. So I expected this function to slurp the whol