Slashdot Mirror


XML::Simple for Perl Developers

An anonymous reader writes "XML has become pervasive in the computing world and is buried more and more deeply into modern applications and operating systems. It's imperative for the Perl programmer to develop a good understanding of how to use it. In a surprisingly large number of cases, you only need one tool to integrate XML into a Perl application, XML::Simple. This article tells you where to get it, how to use it, and where to go next."

5 of 186 comments (clear)

  1. XML::LibXML is where it's at by teknomage1 · · Score: 5, Informative

    XML::LibXML is where it's at, it is a) quite a bit faster and b) has a sensible interfce rather than giving you useless empty hashrefs in the middle of a tree.

    --
    Stop intellectual property from infringing on me
  2. Re:Bah, who the hell still uses perl? by ThatDamnMurphyGuy · · Score: 5, Insightful

    No, professionals write good code, regardless of the language. There is just as much shitty Python/Ruby out there as there is Perl.

  3. Re:Who The Hell Still Uses Perl? by BrianRoach · · Score: 5, Insightful

    "Outside of non-professional teenage Slashdot readers who still think the shitty Perl syntax is 'kewl', who the hell cares about the language anymore?"

    I usually don't reply to trolls, but ...

    The answer is hundreds of thousands of people around the world who use the correct tool for a given job, rather then trying to hammer in screws with the "latest and greatest".

    PS, if you're not clueless and actually are a professional software developer, you can write code in perl that is every bit as readable as . It even supports comments!

    - Roach
    (Who writes code in perl, as well as a number of other languages depending on the task at hand.)

  4. Re:What? by jtolds · · Score: 5, Funny

    "Leverage the power of XML" by deprecating it wherever you can for a more sensible cross platform format.
    </rant>


    1. Advocate XML deprecation.
    2. Use XML style conversation markers.
    3. ???
    4. Profit!!!

  5. Re:Bah, who the hell still uses perl? by Anonymous Coward · · Score: 5, Insightful

    So you have never used APL, eh?

    Perl is derided by people who quite frankly don't have a clue.

    We get lots of flammage from the Java and Python programmers that seem to be unable to grasp that when they try to justify their language choices by putting down other languages, they demonstrate how clearly idiotic their choices are. They cannot come up with something better than "line noise"? My god, have they not heard of the obfuscated code contest?

    One can write unreadable code in any language. Perl is not unique in this regard. Moreover, Perl itself does not admit more unreadable code than other languages. The regex engine in Perl is a language unto itself. You don't need to use it, ever. But once you do, you realize how incredibly powerful it is. And you learn how to parse it, and even more scary, emit it, in your head. What takes hundreds of lines in Java (well what doesnt) becomes single digit number of lines in Perl.

    In my career, I have used APL, Assembly (x86, 8080/Z80, 6502, 6800, F8, ...), Basic, C, C++, Fortran (66,77,90,95), Gauss, Icon, Java, maxima/macsyma, mumath, pascal, perl, prolog, python, ruby, R, VB and probably a few I forget in there. The big idea I have learned is to never force fit a tool to a problem. Select the right tool for the right problem. And go from there.

    Perl is wonderful in that it allows for rapid application development, has a really huge library to draw from (www.cpan.org), orders of magnitude larger than competitive languages, an active developer base, an active contributer base, is portable (you can run Perl anywhere, windows, linux, mac, Cray, AIX, ...). It is not the perfect language for everything though, there are some missing bits.

    Ruby is neat, though I am amused by those in the Java community running over to it, thinking it is better than Perl. It is slightly different, but the syntax is actually quite close to perl. Learning it isn't hard once you know Perl, you can go back and forth quite easily. The problem in Ruby's case is speed. This hopefully will improve over time.

    Python is hard for me to use. I am reminded of BASIC on IBM PCs. Some people like it, I don't. Use it if you must.

    Java has always felt to me to be a solution in search of a problem. I haven't seen things that are being done in Java that couldn't be done more quickly and efficiently in other languages. Java has developed a cult-like following. Many people drank the koolaid, committed company resources to it, and poo-pooed other, better solutions. Only to discover that each "advance" meant to deliver more performance dug people in deeper to the hole, made the systems harder and more expensive to develop. And until recently, the vast majority of people were in significant denial over the fact that java was and is just a marketing gimmick for Sun. They drank the koolaid.

    Fortran ... spent 15 years developing Fortran code. May it never reach 16 years.

    APL. You want write only? Parse this: +/x

    In APL, we wrote complex calculation systems in very few lines. It was a tremendously powerful language.

    In Fortran we wrote complex calculation systems in quite a few lines. Not very powerful for IO, really sucked for this.

    In Perl we drive complex calculation codes written in almost any language. Insanely powerful. Expressive and concise syntax, reads well when well written. Good IO, good networking, good system hooks. Can use MVC and web tools, Jifty even comes with a pony.