Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to concatenate the contents of two files?

by ihb (Deacon)
on Sep 03, 2004 at 00:56 UTC ( [id://388182]=note: print w/replies, xml ) Need Help??


in reply to How to concatenate the contents of two files?

You've given several solutions, both Perl and non-Perl, but I thought I'd provide yet another short-cut. It uses the nice File::Slurp module. If you care about memory, don't use this method, but use the way described in Re: How can I concatenate two files? instead.

use File::Slurp qw/ read_file append_file /; append_file('A.txt', read_file('B.txt'));

ihb

Read argumentation in its context!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-26 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found