Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add text to a file

Status
Not open for further replies.

wysiwyg

Programmer
May 8, 2000
6
CA
hello,<br><br>I am just new to perl and would apreciate an answer to a simple question.<br>How do I add text to a file<br><br>for exemple :<br>1) I check the status <br>2) The status is
 
Hmmm - did some of you post get cut off there?<br><br>In response to your question, it all depends on where you want to the text to be entered, and how much text you have to enter.&nbsp;&nbsp;I guess this info was in the missing text from you post.&nbsp;&nbsp;Any chance you could post again?&nbsp;&nbsp;Thanks.
 
<br>&nbsp;To append to a file;<br><br>open(FILE, &quot;&gt;&gt;/path/to/file.db&quot;)<br>print FILE &quot;Im writing to a file&quot;;<br>close(FILE);<br><br>&nbsp;To write to an existing file and to destroy it's contents or create a new file use the same code as above but change the &gt;&gt; to &gt;<br><br>perlkid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top