Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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 lurking in the Monastery: (5)
As of 2018-07-19 21:06 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (420 votes). Check out past polls.