Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: I need to append to text file

by amw1 (Friar)
on Jan 18, 2005 at 17:41 UTC ( [id://423109]=note: print w/replies, xml ) Need Help??


in reply to I need to append to text file

untested
use strict; my $file1 = shift(@ARGV); my $file2 = shift(@ARGV); # open the first file, slurp the contents into # $file1_contents open(FILE1, "<", $file1) or die "Whoops!"; my $file1_contents = <FILE1>; close(FILE1); # open the second file in append mode, print # the contents from file1 into file2 open(FILE2, ">>", $file2) or die "Whoops!"; print FILE2 $file1_contents; close(FILE2);
This is not tested so I may have screwed something up but the idea should work.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-20 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found