--- 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("slurp '$fname' failed"); my @x = slurp($fname) err die("slurp '$fname' failed"); I have two more questions: 1) Error Handling. Is 'err' correct above? Or should it be 'or'? Or a try block? 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. /-\ Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com