On Fri, 2005-03-18 at 10:28, Aaron Sherman wrote:
> On Fri, 2005-03-18 at 05:42, Rod Adams wrote:
> 
> > Hmm. maybe we just need a function that loads an entire file and returns 
> > a string of it, then feeds that to eval.
> 
> Well, I wasn't getting into the IO stuff, but since you said it, this
> crosses a line with many related IO operations. I would call that
> function "read".
[...]
> Thus:
> 
>       eval read :file("foo");

Oh, and

        $fh1.read undef, :into($fh2); # sendfile maybe
        $fh.read undef, :intofile("foo"); # copy via sendfile

is a nice little toy too (that is, read an undefined number of
somethings into $fh2 or file "foo" from $fh1). sendfile(2) can be used
if the IO layers of $fh1 and $f2 match, but I think it can always be
used in the second case. Much of the dirty work may be handled by
Parrot, which I think supports sendfile already.

This also nicely obsoletes File::Copy and IO::SendFile, thus reducing
the number of modules to be ported ;-)

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Reply via email to