develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Recommended file-copying method

Thread Previous | Thread Next
Craig A. Berry
July 8, 2013 03:36
Re: Recommended file-copying method
Message ID:
On Sun, Jul 7, 2013 at 8:29 PM, David Golden <> wrote:

> * uses sysread instead of read, so if your handle wasn't raw for some
> reason, layers are ignored (except for the utf8 flag, which winds up
> lax instead of possibly strict) so you're shooting your foot with a
> machine gun

Anything that claims to be a file copy but is at all concerned about
the encoding of the contents of the file is not actually a file copy.
Trying to maintain otherwise is a major layer violation and is
shooting yourself in the head with a bazooka.  And while there is
probably no Perl primitive that is an especially good basis for an
efficient file copy, sysread is likely the best one there is.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About