Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: file copy

by sh1tn (Priest)
on Nov 28, 2007 at 14:28 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://653539]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-26 01:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found