Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: How can I replace a line (tag) in an XML file?

by mirod (Canon)
on Sep 30, 2011 at 04:24 UTC ( #928700=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How can I replace a line (tag) in an XML file?
in thread How can I replace a line (tag) in an XML file?

You update the initial file the same way you would update a text file, or any other type of file: in this case once you've read the file close it, then open in for writing ans print the output to this filehandle.

The way you use open, the fact that you use sysread are kind of unusual, so either you have a very personal style or you have little Perl experience and you are cargo-culting your way through the problem. You may want to read a little bit about Perl if you need to use it properly. Invest in "Learning Perl", or read the docs (at least the part on open and print, type perldoc -f open to get them


Comment on Re^3: How can I replace a line (tag) in an XML file?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-09-18 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (124 votes), past polls