Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^2: Editing the contents of a variable

by GrandFather (Sage)
on Aug 22, 2012 at 03:52 UTC ( #988941=note: print w/replies, xml ) Need Help??

in reply to Re: Editing the contents of a variable
in thread Editing the contents of a variable

As ww hinted, using a parser to do the heavy lifting is better than hand rolling code to parse XML. The down side for someone starting out is typical modules (in this case XML::Twig is recommended) are pretty daunting. They look like they will take much longer to learn to use than hand rolling just the little bit of code that it seems you will need. In fact that is generally wrong. Especially for XML and HTML, unless you are generating the source files yourself, there are many subtleties and edge cases that will bite you.

If you are writing this code to learn Perl then rolling your own parser will be very educational, but don't expect to get a reliable script written any time soon. If you are writing this to get a job done and learn some Perl along the way it is well worth spending the time to figure out how to use CPAN and (in this case) XML::Twig. Learning to use modules from CPAN is an important part of learning to use Perl effectively.

True laziness is hard work
  • Comment on Re^2: Editing the contents of a variable

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988941]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2018-03-24 14:48 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.