http://www.perlmonks.org?node_id=464360

BaldPenguin has asked for the wisdom of the Perl Monks concerning the following question:

I am doing some research for a presentation and want to get a good feel for how people are using Perl & XML, as well as what modules they use. Could my fellow monks please share their experiences with me. I hope to present to my local PUG and want to make sure I hit the most relevant topics.

Don
WhitePages.com

Replies are listed 'Best First'.
Re: Uses for Perl & XML
by Old_Gray_Bear (Bishop) on Jun 07, 2005 at 16:36 UTC
    I use XML::Simple to generate/parse data streams for a Network Monitoring application. Since I have pretty much complete control over both ends of the pipeline, I can get away with very simple XML structures to pass data between my various plugins.

    At the other extreme is a "display" generator for banking system, where I don't have control over what is coming into the pipe. The application reads a Data Stream and builds an XSLT template to parse and format the stream for an output 'device'. The device may be another application (with a different data structure), a browser (there are three accepted, 'company standard' browsers, each with its own set of quirks to be coded for), a backup device (with the data formated for storage efficiency rather than Human readability), a virtual device (I haven't a clue what is on the other end of the pipe, convert everything into cannonical form and ship), a plotter/printer (several kinds), etc.

    This one started as an XML::Simple application and quickly got out of hand. The second system was based on XML::Tree, and it is starting to have some issues. We may have to fall back to building something unique from XML::Parser, but all the votes aren't in yet.

    ----
    I Go Back to Sleep, Now.

    OGB

Re: Uses for Perl & XML
by dorward (Curate) on Jun 07, 2005 at 16:18 UTC

    Well, I'm using XML::RAI to suck my bookmarks from del.icio.us and store them in a local database. I then have a script to build a list of the most recent 5 bookmarks on my homepage whenever I regenerate the site.

Re: Uses for Perl & XML
by mirod (Canon) on Jun 07, 2005 at 16:26 UTC

    I use Perl and XML mostly for publishing purposes, to go from SGML to HTML pages or fragments (via XML). Also in a lot of the web work I do I process the HTML as XML (usually using tidy to get XHTML from random HTML).

    As for the module I use, as you might have guessed, it's XML::Twig. I also use XML::Simple every now and then, and a LOT of other modules every time I work on the Ways to Rome series.

      That's (Ways to Rome) some great information. I have used Twig before and found it extremely helpful. I had not checked out the site in a LONG time, I plan on reading all of it, thanks.

      Don
      WHITEPAGES.COM | INC

      Edit by castaway: Closed small tag in signature

      Howdy!

      My (limited) need to mess with XML has been handled with XML::Twig. It seemed to be the best approach when I implemented it, and I have no particular motivation to change it...

      yours,
      Michael
Re: Uses for Perl & XML
by gellyfish (Monsignor) on Jun 07, 2005 at 17:24 UTC

    I mantain a number of XML Based modules, and I mostly use (and have used) XML for the integration of a diverse bunch of systems - I work a lot with .NET based systems where XML is the lingua franca for interoperability purposes.

    /J\

Re: Uses for Perl & XML
by Hero Zzyzzx (Curate) on Jun 07, 2005 at 20:12 UTC

    In addition to being recently brought to maintain the module, I use XML::RSS to produce, consume (meaning "publish others content to my sites"), and aggregate RSS feeds in number of different places. RSS is great technology, and it's all XML.

    Moveable Type is one blog that's written in perl and produces/consumes XML via RSS.

    -Any sufficiently advanced technology is
    indistinguishable from doubletalk.

    My Biz

Re: Uses for Perl & XML
by goonfest (Sexton) on Jun 07, 2005 at 20:03 UTC
    I use XML::Simple to read/parse the results of an asp.net web service.

    "Be proud, be a Goon"
Re: Uses for Perl & XML
by astroboy (Chaplain) on Jun 07, 2005 at 20:11 UTC
Re: Uses for Perl & XML
by holli (Abbot) on Jun 07, 2005 at 22:04 UTC
Re: Uses for Perl & XML
by injunjoel (Priest) on Jun 07, 2005 at 23:58 UTC
    Greetings,
    I am currently using XML to configure a parser object I have created for aggregation and scoring of behavioral data generated from psychological research studies. These studies record experimental sessions that are later "coded" by research assistants using a 3rd party behavior coding program. The "codes" they generate corespond to behavioral actions or experimental models. The experimenter presents a given model and the subject is scored on how well they imitate or how frequently the do some action. I take the configuration files from the 3rd party software and parse it into an XML structure (using HTML::Template for configuration file generation). Once the XML is written I then tweak it to fit the needs of each specific study. I load the resulting XML into my parser object with XML::Simple to get it into a Perl data structure that I can use for parsing of the generated "code" files. It makes the entire process much easier than hard-coding the data structure since the research leads can add and subtract any given element in the XML configuration files as they see fit. Once the data is parsed and scored the statistical analysis can begin. It has saved many a man hour since the scoring and such no longer needs to be done by hand.
    In the past I have used XML with SQL, Perl and Flash ActionScript to get dynamic content into Flash presentations for online portfolios and configurable, clickable city maps. With the widening suppor for XML in different programs, sharing data between software packages has become more and more of a reality.
    I initially scoffed at the idea of XML since most of the buzz surrounding it was how it would revolutionize document searches and such... stuff that good design and a reasonable database should accomplish. However I have since "seen the light" and now use XML to describe the structure of my data in a configurable way.

    -InjunJoel
    "I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo