Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: file copy

by sh1tn (Priest)
on Nov 28, 2007 at 14:28 UTC ( #653539=note: print w/replies, xml ) Need Help??

in reply to file copy

If the source file is small you can use File::Slurp

use File::Slurp; my $file_src = shift; my $file_dst = shift; write_file($file_dst, {'binmode' => ':raw'}, read_file($file_src, {'bi +nmode' => ':raw'}));

Replies are listed 'Best First'.
Re^2: file copy
by tirwhan (Abbot) on Nov 28, 2007 at 15:33 UTC

    Umm, what would be the point of that? File::Slurp

    • is not in core and will only work with Perl version 5.005+
    • seems to have issues with Unicode files as well as several unadressed bug reports
    • does not help with any platform issues
    • usage is just plain unintuitive for a maintenance programmer in this case

    I'm not trying to knock File::Slurp, it's probably good at what it does (though the numerous, long-running bug reports would give me pause), but what possible reason (other than obfuscation) would you have for using it in this case?

    All dogma is stupid.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://653539]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2018-06-22 02:07 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (120 votes). Check out past polls.