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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to append to the start of a file? 1

Status
Not open for further replies.

ailse

Programmer
Jan 20, 2004
79
GB
Hi,

I have some xml that I am processing using XML::Simple - my problem is that I am working with XML that needs two tags appending to the top and bottom of the document:

my original file:

Code:
<a tag>
</a tag>

<a tag>
</a tag>

what it should look like:

Code:
<master tag>

<a tag>
</a tag>

<a tag>
</a tag>

</master tag>

if i open the xml file for writing then ">>" will only append to the end of the file, so how can i stick the text to the start of the file as well?

any help greatly appreciated :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top