Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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'}));



Comment on Re: file copy
Download Code
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
Node Status?
node history
Node Type: note [id://653539]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2014-08-28 15:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (263 votes), past polls