Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Search and replace query

by RichardK (Parson)
on Aug 26, 2011 at 07:58 UTC ( #922577=note: print w/replies, xml ) Need Help??


in reply to Search and replace query

Your data looks like it's XML, so if it is you might find it easier to use an XML parser. A parser will handle any non significant whitespace or formatting changes & you can focus on only what's important to you.

You could try XML::Simple to read the file into a hash and then modify the hash.

Just a thought :) HTH

Replies are listed 'Best First'.
Re^2: Search and replace query
by Lotus1 (Vicar) on Aug 26, 2011 at 08:50 UTC

    Since the order of the keys is not preserved in a hash and the order of elements seems to be important here XML::Simple won't do the job. This would be easy with xpath.

    On second thought XML::Simple could work. You could check if the parent of this node contains a child with bindname=abcde.

      Since the order of the keys is not preserved in a hash and the order of elements seems to be important here XML::Simple won't do the job. This would be easy with xpath.

      XML::Simple knows how to array

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2019-11-13 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (74 votes). Check out past polls.

    Notices?