Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: How do I write to a file?

by Crulx (Monk)
on Jan 21, 2000 at 04:54 UTC ( #2289=note: print w/replies, xml ) Need Help??

in reply to How do I write to a file?

The open command opens a file. The first few characters of the second argument tell you how the file is opened. This code
open FH , ">$output_file";
truncates and opens a file for writing. All the contents are lost.
open FH, ">>$output_file";
Opens a file for appending. When you start writing to this file, it will write to the end. To actually WRITE to that file you use the print command
print FH "I will print this to a file\n";

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2022-09-30 07:19 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (125 votes). Check out past polls.