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."

186 comments

  1. Sweet! by bennomatic · · Score: 0
    Or in other words, XML-ent!

    --
    The CB App. What's your 20?
  2. Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0, Flamebait

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

    http://www.ruby-lang.org/en/

    1. Re:Who The Hell Still Uses Perl? by shobadobs · · Score: 1, Flamebait
    2. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      Outside of non-professional teenage Slashdot readers who still think the shitty Perl syntax is 'kewl',
      Shitty... as opposed to what, PHP?
    3. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0
    4. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      So true man, Haskel is the rage amongst us bearded, short pants donning, backpack with both arms wearing grad students.

      We talk about it all the time at our on campus barbecues when we aren't complaining about our advisors or playing frisbee golf.

    5. 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.)

    6. Re:Who The Hell Still Uses Perl? by andres32a · · Score: 4, Insightful

      Slashdot.org!!

    7. Re:Who The Hell Still Uses Perl? by Lars512 · · Score: 2, Interesting

      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".

      I tend to use Python for most things, and consider it a general purpose language, suitable for all but performance critical tasks. I'd put Perl and Ruby in the same basket, as general languages with many libraries which just help you get things done. To me, these languages seem pretty interchangeable in this respect. In that case, the choice of which to use comes down to personal experience alone.

      I'm curious as to whether you have a different opinion. Lets leave aside issues of syntax. What libraries or other features would you consider makes Perl the correct tool for a particular task? Are there particular tasks for which you use other scripting languages, in particular Python or Ruby?

    8. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      or ocaml.

    9. Re:Who The Hell Still Uses Perl? by TheSkyIsPurple · · Score: 4, Insightful

      I don't know about GP, but I've got a couple hundred hosts that have PERL installed, but not Ruby or Python, and getting those others installed would require alot of work. (some technical, given the age and OS on some of them... but mostly configuration management style issues)

      Since there is alot of PERL code already doing work in this environment, and PERL is on everything already... it makes sense to stick with what's there.

    10. Re:Who The Hell Still Uses Perl? by fyngyrz · · Score: 3, Interesting
      Shitty... as opposed to what, PHP?

      Well, certainly as opposed to Python, anyway. I went from perl to Python with a huge sigh of relief. I try to move a still-used perl script from perl to python once a week. Eventually I'll get them all, and I can leave the language behind. But I wrote tons of perl before I discovered Python and it is a long, long road to upgrade all that stuff. But every time I do one, I get a more maintainable, more english-like tool. Sometimes it takes me several minutes to even understand what the heck a perl script (even one of mine) is trying to do. Perl just... doesn't lead you to the most readable solutions. In fact, the better at it you get, the more obscure looking your programs get, it seems to me. That's an IMHO. :)

      Anyway, if someone is looking for a scripting language today, Python is the cat's meow. Readable, sensible, extensible, flexible, well supplied with great libraries of functionality, powerful as hell, very easy to debug, not unreasonable in speed.

      --
      I've fallen off your lawn, and I can't get up.
    11. Re:Who The Hell Still Uses Perl? by poopdeville · · Score: 0, Flamebait

      But I wrote tons of perl before I discovered Python and it is a long, long road to upgrade all that stuff. But every time I do one, I get a more maintainable, more english-like tool. Sometimes it takes me several minutes to even understand what the heck a perl script (even one of mine) is trying to do.

      That's your own damn fault.

      --
      After all, I am strangely colored.
    12. Re:Who The Hell Still Uses Perl? by karthikg · · Score: 0

      I agree with you. In my case, I had a brief stop at TCL. I had a useful app which I moved to Python since I no longer want to make changes to it's TCL version. For those PERL scripts, I don't even care if they disappeared. In fact, I loved TCL lot more than Perl. Of course, when I first met Perl from the world of sh/C, it felt like heaven.

      BTW does any of those complaining about Python, give one reason other than indendation, as a problem? (Oh come on, don't say some arbitrarily complain about slowness)

      Recently I was studying about the next move.. no didn't find enough reasons to move/try Ruby.

      Karthik

    13. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      As another poster mentioned, some of us work with systems that don't have Perl in the default install or as a vendor supported package.

      I like Perl, Python, and Ruby. In our environment (OpenBSD & AIX), Perl is the language installed on the systems by default. It's on the vendor installation media. It is installed by default. Python and Ruby may be available as a package, but Perl is already there.

      I may write Python and Ruby for things that stay my workstation, or on a for a specific task on server that for other reason we have explicitely added Ruby or Python, but if a program is going to run across all our machines it is written in Perl or shell.

    14. Re:Who The Hell Still Uses Perl? by JourneyExpertApe · · Score: 1

      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 . I don't know about you, but I don't find " ." very readable. If that's what modern Perl syntax looks like, then I don't wanna go there.
      --
      If you can read this sig, you're too close.
    15. Re:Who The Hell Still Uses Perl? by Elias+Israel · · Score: 0, Flamebait

      A well-designed programming language enables great programmers to create masterworks, encourages good programmers to produce great code, and makes bad programmers go looking for another profession.

      Perl causes great programmers to produce good-enough code, makes good programmers produce bad code, and enables bad programmers to consider themselves software experts.

      That said, anything that permits programmers in any language to work in XML is probably a good thing. Might teach them a few things about structure, flow, and interoperability.

      Now you kids get off my lawn.

    16. Re:Who The Hell Still Uses Perl? by texwtf · · Score: 4, Interesting

      The fact that whitespace is dogmatized by the pyhon community makes the community
      itself less attractive, and the language because of it. It sends the message that
      it doesn't really matter what you want, the language is perfect and your code
      is crap because you are too stupid to agree with how right the community is.

      Guido could _easily_ put in some sort of pragma to allow other types of blocks, it's
      only a matter of arrogance that stops him- coding with whitespace is the "right" way to do it.

      There's also the matter of the parser. The last time I used Python everything was a syntax error, which gave little indication what was actually wrong with a piece of
      code.

    17. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      I think it involved goatse-like accident with a bolwing pin. Some people claim it wasn't actually an accident.

    18. Re:Who The Hell Still Uses Perl? by daliman · · Score: 1

      Hmmm... If you were feeling like playing devils advocate, you could suggest that the situation is the same with Windows... Of course I would never say such a thing!

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

      Guido could _easily_ put in some sort of pragma to allow other types of blocks, it's
      only a matter of arrogance that stops him- coding with whitespace is the "right" way to do it.
      There is are very good reasons for having indentation indicate a block.

      Firstly, code written by different programmers is consistently indented. C and Java programmers could argue for a millennia about where to put the curly brace, but in the end the argument is just trivial. If everyone did it the same way code would be much more readable. Sure, the language gives you freedom to work the way you want but it does so at the expense of readability.

      Another reason is that indentation easily shows that one block is the child of another. Again, this makes Python code much more readable than it otherwise would be without it.

      I don't think the decision was a matter of arrogance at all. It's logical, and it makes sense. Programming is often said to be part art, part science, but trading a little bit of expression in the way you indent your code for readability (and hence maintainability) makes sense to me. It does take a bit of getting used to, sure, but it is worth the effort when you come back to the code at a later date, or try to understand someone elses.

    20. Re:Who The Hell Still Uses Perl? by localman · · Score: 2, Insightful

      In fact, the better at it you get, the more obscure looking your programs get

      Well, I can tell you that's not true. If you're willing to believe me, I'll claim that I've become very proficient at perl in the past 9 years and my code has become much easier to read. I think those who have worked with me would agree. Some have even said so specifically. You just have to have a little self dicipline and a sense of clarity and aesthetics.

      Now, if you don't have such sense, or if you just like another language, that's totally cool. Whatever works for the job. But perl is a medium (like oil or watercolor) and you can make beautiful programs with it. It just doesn't do anything to assist you in that endeavor :) Still, it's my favorite language (I've only ever dug into java and c++ as alternates).

      Cheers.

    21. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 1, Insightful

      Python is English-like in the sense that VB.NET is English-like, which is to say, nothing at all like English. It's clumsy, unnecessarily verbose, overlogical and obtuse. There's no artistry to it; every Python program looks exactly the same regardless of functionality or intent.

      Perl is for poets. Python is for autistic geeks who wish the world were expressed in maths.

    22. Re:Who The Hell Still Uses Perl? by abigor · · Score: 1

      The world actually is expressed in math. I hate to break it to you. And in places that matter (ie not your bedroom), Perl is dying as companies grow sick of the costs of maintainability. Welcome to the real world.

    23. Re:Who The Hell Still Uses Perl? by chromatic · · Score: 1

      Sometimes it takes me several minutes to even understand what the heck a perl script (even one of mine) is trying to do. Perl just... doesn't lead you to the most readable solutions.

      Hasty generalization. Perl didn't lead you to the most readable solutions. That's fine; personal taste is a big factor in language preference. However, I (and plenty of other good coders I know) write maintainable Perl.

    24. Re:Who The Hell Still Uses Perl? by TheSkyIsPurple · · Score: 1

      No kidding... there's a reason I'm doing a ton of VBScript work now... We've got several hundred of those as well, and guess what they all have? =-)

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

      There are very good reasons not to. Thus, dogma. My argument is "everyone else does it the other way, maybe being flexible would be good." Your argument is "I am right and my way is good, so there shouldn't be any other way". That's Guido's argument too.

    26. Re:Who The Hell Still Uses Perl? by vandan · · Score: 1

      Glad you asked. I do. And I like it. Got a problem with that?

    27. Re:Who The Hell Still Uses Perl? by fatphil · · Score: 2, Interesting

      I recommend you start a yahoogroup for the discussion of Python. The same applies to YAML advocates too, of course. Exchange a few snippets of code/data.

      Hopefully you'll then realise how non-portable a white-space-based convention is.

      --
      Also FatPhil on SoylentNews, id 863
    28. Re:Who The Hell Still Uses Perl? by spottedkangaroo · · Score: 1

      > PERL

      Just an fyi ... Perl isn't an acronym and that capitalization is used to recognize inexperienced Perl programmers. My guess is you don't like Perl becuase you never really got into it. Perl vs Python vs Ruby vs Pike is a pretty silly thing to argue. It's largely a matter of preference like vim vs emacs. So the whole argument is ridiculous...

      But Perl isn't an acronym.

      --
      Imagine if you weren't allowed to use roads because a bus company complained about your driving 3 times. --skunkpussy
    29. Re:Who The Hell Still Uses Perl? by emazep · · Score: 1

      Shitty as PHP's syntax is, it's still better than perl's.
      This statement tells a lot about how ignorant you are.
      Learn how sweet PHP is

      Though a bad coder can write Perl code hard to understand (not that hard anyway), thanks to its freedom, Perl is by far the imperative language easiest to read and to maintain.
      This requires a decent coder of course, but this is easy accomplished too, since the bad ones have all gone with PHP.
    30. Re:Who The Hell Still Uses Perl? by cwis42 · · Score: 1

      But Perl isn't an acronym.
      Practical Extraction and Reporting Language??
    31. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      Outside of non-professional teenage Slashdot readers who still think the shitty Perl syntax is 'kewl', who the hell cares about the language anymore?
      Plenty of people. For example, professional adult Slashdot readers who need a language that is reasonably fast, ubiquitous, and suitable for writing quick text-munging scripts.

      Besides, the non-professional teenagers who love "kewl" syntax have mostly switched to drooling over Ruby, which is slow, not widely available, and only really useful for the way Rails makes it easy to write the Next Big Web 2.0 Flop.
    32. Re:Who The Hell Still Uses Perl? by pooh666 · · Score: 1

      I would bet the same thing would have happened if you had rewritten all of your code over again, in Perl or any other lang. I think you are confusing the fresh start that a new lang is giving you, with the ability to write more readable code. More and more, when I see any post, no matter how well reasoned at acts like any lang, scripting or otherwise is "BAD" makes me thing the person saying that is just trying to blame their own issues on a source outside of themselves. It is amazing how many otherwise intelligent people make this mistake. I did the same thing with PHP, the attitude of some of its core developers sickens me and there is a lot about it that feels slapdash to me as a result, however, it does make a lot of tasks very easy, and its default performance isn't too bad. But then people expect it to do everything *BE* scalable etc when scalable is ALWAYS a lot of work and effort no matter what lang platform you are using. Try to deny that! In other words you can misuse any tool and blame it on the tool.

      As for the topic of this post, what are we talking about shoes? Are you kidding? I, like most people who got into tech, got into it because we appreciate a scientific point of view. We like thinking that way. This subject, "Who The Hell Still Uses Perl" sounds like it could as easily be who still wears red or something.. If you want to talk to the best of us, then don't screw yourself over right away with this kind of obviously emotional tag right off.

    33. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      Is a backronym, as are any others associated with perl. Larry wanted to call it "Pearl", but the weirdo filesystem on the system he developed it on only allowed four letters, or so he claims. My guess is that such a system was probably monocase too, so then it probably was called PERL. For most of us though, history begins with unix, since the first actually released version of perl was for it.

    34. Re:Who The Hell Still Uses Perl? by Darby · · Score: 1

      I think you mean Pathologically Eclectic Rubbish Lister.

      IIRC Larry Wall actually coined that phrase too ;-)

    35. Re:Who The Hell Still Uses Perl? by nuzak · · Score: 1

      > Perl is dying as companies grow sick of the costs of maintainability.

      They sure as fuck aren't moving to a language that doesn't even have the same capabilities of use strict;. Yeah, we all just love how python ignores typos in variable names because it has no concept of a declaration.

      --
      Done with slashdot, done with nerds, getting a life.
    36. Re:Who The Hell Still Uses Perl? by nuzak · · Score: 1

      Python's a lot better about locating errors than it was in the 1.x series, including whitespace ones. I'd try it again if that's all that got to you. The whitespace thing still occasionally irks me, but it's pretty evenly balanced by not having to use semicolons.

      I find python's "half open ranges" and lack of variable declaration far more irritating than anything else.

      --
      Done with slashdot, done with nerds, getting a life.
    37. Re:Who The Hell Still Uses Perl? by radtea · · Score: 1

      The fact that whitespace is dogmatized by the pyhon community makes the community
      itself less attractive, and the language because of it


      This put me off python for a long time, too. "Whitespace is not actually evil--it is just misunderstood" is a lesson I learned from SGML-based text processing, where concepts like "ignorable whitespace" reflect the reality of how strangely humans interpret such things.

      But once you get over the fact that a fundamental aspect of the language's structure is based on a character set that many text editors feel free to misrepresent to the user, you'll find that python has some signficant benefits over Perl, especially for application prototyping and exploratory coding. For pure text processing I'd still choose Perl, and Perl still leads in terms of number of libraries to handle common and even pretty uncommon tasks, but python's native OO syntax and good GUI support via wxPython and the like make it a useful tool for a developer to have.

      --
      Blasphemy is a human right. Blasphemophobia kills.
    38. Re:Who The Hell Still Uses Perl? by nuzak · · Score: 0, Flamebait

      PHP is an oddity -- the syntax is okay, and since PHP5 it actually has some nice features like interfaces that move it toward an optional-static-typing model.

      But the language is still a dumping ground of half-assed inconsistent global functions and it still demands those ridiculous PI tags surrounding every source. It still has problems dealing with its own object reference semantics (the === operator doesn't actually compare references for example). It's got the syntax down, at least as a "sane perl" goes, but virtually nothing else.

      Maybe PHP6 will make PHP tolerable. Considering that the same morons are designing it, I'm not holding my breath.

      --
      Done with slashdot, done with nerds, getting a life.
    39. Re:Who The Hell Still Uses Perl? by ksheff · · Score: 1

      I guess we're still waiting for that "well-designed programming language". :D

      --
      the good ground has been paved over by suicidal maniacs
    40. Re:Who The Hell Still Uses Perl? by Lord+Ender · · Score: 1

      I'm curious: What hosts are you writing for which don't support modern high level languages (without excessive effort)?

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    41. Re:Who The Hell Still Uses Perl? by Lord+Ender · · Score: 1

      Guido could _easily_ put in some sort of pragma to allow other types of blocks
      but he won't, because that would be stupid. It would be akin to having differently-sized railroad tracks depending upon the whim of the person laying them.

      Only a PERL programmer would think that is a good idea :-)
      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    42. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      The trouble you're having with Python is probably the same thing that's causing your slashdot comments
      to be
      all
      like this

    43. Re:Who The Hell Still Uses Perl? by TENTH+SHOW+JAM · · Score: 1

      (bites)

      Having used PHP, Perl, SQL HTML, and CSS on various projects all at once, I have to say that whilst the syntax of Perl is fairly bad, once you mix php script with html and SQL you end up with an unreadable mess. There is no escape from this. I have reformatted my code any number of ways to get "easy to read" code out of php, and I can't do it.

      The down side of this is that I tend to write small easy tasks in php and big complex tasks in Perl. Simply because Perl is able to be formatted in a reasonably readable format.

      Yes I will admit that Python lays out better than Perl. I just have allergies to white space dependant languages. I've tried. $DEITY knows. But I cannot get the hang of formatting my code the "Python Way". This is my shortfalling, not Python's.

      --
      A sig is placed here
      To display how futile
      English Haiku is
    44. Re:Who The Hell Still Uses Perl? by Anonymous Coward · · Score: 0

      > Anyway, if someone is looking for a scripting language today, Python is the cat's meow.

      Not for me though. Python just doesn't have that comfortable feel that Perl has. Python chooses funny names for things (dictionary instead of hash?), puts docstrings in the wrong place (under instead of above?), and its 2 similar ways of doing OOP (new style vs. old style classes?) seems a little to complicated. Perl just looks right (semicolons to end lines, braces to enclose blocks), its OO is dirt simple, and it basically ``just works''. Plus POD is trivial to use and works perfectly with the perldoc command.

      Sorry, but if you want to replace Perl, you've gotta have something at least twice as good, and Python and Ruby aren't it. I'm hoping Perl 6 will be that replacement, but if it isn't, Perl 5 works fine.

    45. Re:Who The Hell Still Uses Perl? by rgravina · · Score: 1

      Non-portable? I'm not sure how whitespace changes from platform to platform. Am I misunderstanding something there? Anyhow, it doesn't matter whether a block is indented by a tab, one space, two, four etc. as long as everything at that level is indented consistently. Does this help?

      Even if code sent through Yahoo groups/in the body of an email can't be easily copied-pasted-and-compiled (is that what you are referring to?), I don't really see that as a huge disadvantage. You could just attach the file.

      I'm open to suggestion - perhaps those that like freedom in indentation have a point, but I just can't see it. Trade a penny in freedom of block layout and get back a pound in consistency and readability.

    46. Re:Who The Hell Still Uses Perl? by chromatic · · Score: 1

      Perl Expanded a Regex Language too, but that still doesn't make it an acronym.

    47. Re:Who The Hell Still Uses Perl? by chromatic · · Score: 1

      ... python's native OO syntax and good GUI support via wxPython and the like make it a useful tool for a developer to have.

      wxPython I give you (and I throw in py2exe for free, because it's useful), but "native OO syntax"... not really so much. Declaring parameters in signatures is nice (except that you don't get the invocant), but static default values, ouch.

    48. Re:Who The Hell Still Uses Perl? by chromatic · · Score: 1

      Trade a penny in freedom of block layout and get back a pound in consistency and readability.

      Any decent editor can reindent code. No editor can improve poor symbol names. The latter has much, much more to do with maintainability than indentation.

    49. Re:Who The Hell Still Uses Perl? by fatphil · · Score: 1

      You've not started a yahoogroup, and seen what breaks. You've not even hunted
      out any yahoogroups for python to see what goes wrong. And yet you have the
      gall to question what I've previously stated? Sheesh, the impudence.

      Your wish for "indented consistently" is granted.
      Unfortunately for you the indentation level is 0 everywhere.
      Still think your python code will work if posted there?

      Not every medium is whitespace friendly. This is why things like quoted-pritable
      were invented, and things like base64 and uuencode specifically avoid the space
      character.

      --
      Also FatPhil on SoylentNews, id 863
    50. Re:Who The Hell Still Uses Perl? by TheSkyIsPurple · · Score: 1

      >My guess is you don't like Perl becuase you never really got into it

      You kidding? I love perl. I never said anything against it.

      Don't read too much into a typo my friend =-)

    51. Re:Who The Hell Still Uses Perl? by TheSkyIsPurple · · Score: 1

      I didn't say it would be technically difficult. It would just take awhile to prove that the other software wouldn't affect our environment. It would require alot of formal testing, documentation, discussions, and meetings. Then after that we'd end up supporting scripts in more than one language since the old code won't disappear overnight.

    52. Re:Who The Hell Still Uses Perl? by dasir · · Score: 1

      I aggree with you. PHP is totaly crap! Now, Im working on my own project (Designing my own templating-system/mini-language like ASP) Hey, slashdot is written in Perl right :-)

      --
      eval($i);$i="',rekcah 6lreP rehtona tsuJ'tnirp=_$";
    53. Re:Who The Hell Still Uses Perl? by davorg · · Score: 1

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

      Perhaps people who want to work for the dozens of Fortune 500 companies who have huge numbers of systems written in Perl. Or perhaps people who want to work for the large number of internet startups that use a lot of Perl code.

      But, hey, if neither of those options really appeal to you then feel free to use something else. The fewer people that want to write Perl, the more I get paid for writing it.

    54. Re:Who The Hell Still Uses Perl? by Intron · · Score: 1

      The PHP syntax is very similar to Perl and C.

      From the PHP Tutorial

      --
      Intron: the portion of DNA which expresses nothing useful.
    55. Re:Who The Hell Still Uses Perl? by emazep · · Score: 1

      PHP is an oddity -- the syntax is okay, and since PHP5 it actually has some nice features like interfaces that move it toward an optional-static-typing model.
      Was my attempt to be ironic too cryptic? ;-)
      Just have a look at the page I mentioned in my node: http://tnx.nl/php and you'll see how irremediably shitty I think PHP is.
    56. Re:Who The Hell Still Uses Perl? by mzieg · · Score: 1

      > its 2 similar ways of doing OOP (new style vs. old style classes?) seems a little to complicated

      Technically, Perl has two OOP syntaxes, too:

      my $obj = new Foo();
      my $obj = Foo->new();

    57. Re:Who The Hell Still Uses Perl? by rgravina · · Score: 1

      You've not started a yahoogroup, and seen what breaks. You've not even hunted
      out any yahoogroups for python to see what goes wrong. And yet you have the
      gall to question what I've previously stated? Sheesh, the impudence.

      Actually, I just wasn't sure what you were getting at and wanted clarification; I wasn't questioning your statement. Clearly you've had more experience than myself with these issues, since the possibility of whitespace being non-portable hadn't crossed my mind.

      Having said that, I have recently tried sending Python code via Google groups. Most people just attach files to messages, and that avoids the whole problem, but I didn't have any major problems copy/pasting my code from a web page either. The only problems I encountered were that lines were wrapped and pasted as seperate lines (this would effect most languages though). After fixing this, the code worked fine.

  3. 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
    1. Re:XML::LibXML is where it's at by rvalles · · Score: 4, Informative

      I agree completely. I've used both recently (and XML::Xpath) and XML::LibXML is much more powerful and sane, while at the same time it is about as easy to learn. There's the added advantages that being just LibXML bindings what's learned is useful in other programming languages, and that nodes are referred using Xpath, which is a really powerful and useful W3C standard that, again, is worth learning.

    2. Re:XML::LibXML is where it's at by Anonymous Coward · · Score: 0

      If you know how to tell XML::Simple how to treat various tags you end up with a fairly simple and consistent data structure. And if the ForceArray, ForceContent and other options do not give you enough power you may try XML::Rules. There you can specify exactly what part of data are you interested in for each tag, simplify the data structure as the XML is parsed, handle the data whenever you have all you need etc. All without having to access tag content and attributes through methods with long names. And without loading the whole document into memory and eve converting it into a huge maze of interlinked object :-P

      In short ... use the module that works for you.

  4. 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.

  5. Propogation by Anonymous Coward · · Score: 0

    Great, the XML bloat and slowness continues to propogate out of document storage...

    1. Re:Propogation by Anonymous Coward · · Score: 0

      It's "Propagation". Learn propa English!

    2. Re:Propogation by Anonymous Coward · · Score: 0

      Sorry for the mistake. I'll learnd da propa English from you.

      It is too bad that you can not correct submissions. But, hey, this *IS* slashdot.

  6. Re:Bah, who the hell still uses perl? by LM741N · · Score: 1, Troll

    Yes, but at least with Python you can read and understand the shit- and then fix it if need be.

  7. Re:Are you serious? by Anonymous Coward · · Score: 0

    You, sir, sound look someone who does not understand Perl. Decent Perl looks like an unreadable mess only to VBScript programmers.

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

    Professionals use Perl and Ruby.
    Idiots Indentation Nazis use Python.
    Python is as a Python will always be, slow and constricting.
    Coding in Python is like baby talking to a 2 year old. It's f*cking annoying.
    Go back to Basic or Turtle!

  9. Re:Bah, who the hell still uses perl? by soapbox · · Score: 3, Insightful

    fine, I'll feed the troll.

    Parsing perl with wet-ware isn't always easy. Obfuscating your code in the name of optimization should be countered with good commenting. Every useful script will have to be maintained, and the grandparent post is totally correct. I work minor miracles with Perl; or, miracles to me, anyway--I couldn't have created my dissertation data without Fortran--specifically g95--and Perl.

    I know there are lots of useful languages out there. Every language has its fanboys. Heck, I liked the PDP-11 macro language a lot. If people produce useful code with Perl, don't complain about it; be glad for them.

  10. good lord... by Anonymous Coward · · Score: 0, Insightful

    XML has become pervasive in the computing world and is buried more and more deeply into modern applications and operating systems.

    Man, that's the scariest thing I've read all day. IT'S BURROWING INTO THE SYSTEM!! AHHHH!!!! ANGLE BRACKETS EVERYWHERE!

    Seriously, the first thing that came to mind was the type of stuff you read on thedailywtf.com.. something like: "And then Joe realized that the reason the string_to_upper() was so slow was because it was calling a SOAP service on a machine at the lead developer's previous employer, passing 23K of XML in both directions...." .. And then INVARIABLY, there's a reply that says "Hey, that isn't such a bad idea...."

    So, no thanks, I don't want XML burying itself in my code any more than I want my music player to squirt songs.

  11. How is this news? by poopdeville · · Score: 0, Redundant

    How is this news? XML::Simple is old. Really old. 1999 old.

    --
    After all, I am strangely colored.
    1. Re:How is this news? by Anonymous Coward · · Score: 0

      It isn't news. It was a stupid joke.

    2. Re:How is this news? by Intron · · Score: 1

      Yes. But someone has finally figured out how to use it.

      --
      Intron: the portion of DNA which expresses nothing useful.
  12. What? by cliveholloway · · Score: 4, Insightful

    This is the most pointless article I've seen linked from slashdot in a long time (and yes, I've seen a lot of crap here). What is the point of posting a run of the mill tutorial on something that's been covered many times before?

    Having spent a lot of time playing with this crap lately, can I just butt into this pointless thread and say screw XML, use YAML or JSON instead. XML is a steaming, clumsy overrated turd. I benchmarked XML::Simple against YAML::Syck - the latter encoded 2.5 times faster and parsed nine times faster than XML::Simple. The syck library is indeed aptly named.

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

    </rant>

    --
    -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    1. Re:What? by archen · · Score: 1

      I'm a YAML convert myself. I used to use XML::Simple quite often for configuration files but generally wasn't to happy with the readability of what it generated. YAML by contrast was pretty easy to read and write your configs by hand if you wanted (a pain with XML). However XML isn't going anywhere soon. In some industries XML is just now starting to grab attention for interoperability and I've had to deal with XML stuff that was just handed to me more and more. In that sense XML::Simple has made my life much easier.

    2. Re:What? by colinbrash · · Score: 1

      Ignoring the YAML/XML thing, this is still pointless. How many people using Perl don't know how to use CPAN? How many people using Perl can't understand CPAN docs? How many people reading the XML::Simple docs need further help? It's called XML::Simple for a reason! It really IS simple.

    3. Re:What? by Cthefuture · · Score: 1

      Are there XML-RPC equivalents for YAML and/or JSON? Although I'm sure it would be easy to create something I am just wondering if there is any sort of standard.

      How do you process YAML or JSON in Javascript (eg. in a browser)? Most browsers have built-in support for processing XML.

      --
      The ratio of people to cake is too big
    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:What? by maxume · · Score: 1

      eval('(' + json + ')'). There are libraries if you don't trust your source:

      http://www.json.org/js.html

      is one.

      --
      Nerd rage is the funniest rage.
    6. Re:What? by Kangburra · · Score: 1

      XML is a steaming, clumsy overrated turd
      You don't like it much then!? ;-)
      --
      Common sense is not so common
    7. Re:What? by cliveholloway · · Score: 1

      I TELL YOU IT'S A FRICKIN' PLAGUE!!!

      lameness filter encountered - need this line to post...

      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    8. Re:What? by cliveholloway · · Score: 1

      Can you tell I was in a bad mood? :)

      No, I understand that it *can* be well used, just that for 90% of the applications it *is* used for appear to only be using it because the author once read somewhere that leveraging XML was the way forward. If you're dealing with data storage only, XML is always the wrong answer(*).

      cLive ;-)

      (*) unless the question is, "What is the worst format to store configuration data in?" :)

      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    9. Re:What? by Anonymous Coward · · Score: 0

      Ignoring the YAML/XML thing, this is still pointless. How many people using Perl don't know how to use CPAN? How many people using Perl can't understand CPAN docs? How many people reading the XML::Simple docs need further help? It's called XML::Simple for a reason! It really IS simple.

      What are "CPAN docs"? If you can figure out how to install one module you can figure out how to install them all. Also since you know how to read the docs for XML::Simple you know how to read them for the other one as well.

      Perhaps XML::Simple is easier to use, but your line of reasoning is like saying it is harder to buy a Ford than a Chevy so buy the Chevy. Built on extremely flawed reasoning.

    10. Re:What? by colinbrash · · Score: 1

      What are "CPAN docs"? If you can figure out how to install one module you can figure out how to install them all. Also since you know how to read the docs for XML::Simple you know how to read them for the other one as well.

      Perhaps XML::Simple is easier to use, but your line of reasoning is like saying it is harder to buy a Ford than a Chevy so buy the Chevy. Built on extremely flawed reasoning.


      I'm not saying buy anything or use anything or whatever. I'm just saying the article is pointless.

      CPAN docs are the documentation that goes along with a module. In this case:

      http://search.cpan.org/~grantm/XML-Simple-2.16/lib /XML/Simple.pm

      Yes, if you can install one perl module, you can install any other (to a degree). So what's the point in explaining how to install a perl module? Point the reader to one of the millions of other places that already explain it.

      But more importantly, the XML::Simple documentation is very good and very easy to understand. Why is there an article that basically regurgitates the documentation? Just point the reader to the documentation instead!

      I'm afraid I don't understand your analogy at all.

    11. Re:What? by hoggoth · · Score: 1

      > How do you process YAML or JSON in Javascript (eg. in a browser)? Most browsers have built-in support for processing XML

      Wow, that must be great having support for XML built into Javascript.
      Oh, by the way, JSON is expressed in valid Javascript syntax. That means JSON is already Javascript. No libraries or support necessary.

      Sorry for the snarkiness. 'Been struggling with some XML code. That always puts me in a bad mood.

      --
      - For the complete works of Shakespeare: cat /dev/random (may take some time)
    12. Re:What? by Anonymous Coward · · Score: 1, Funny

      (*) unless the question is, "What is the worst format to store configuration data in?" :)

      I can think of worse. How about a flat namespace populated with pairs of the form (name, number). After that list, you can have a giant (about 2^19940 bytes long) of 8 byte values, related to the pairs as follows: the key with name 'pair' has the value stored in the M(number)th bin, where M is the Mersenne Twister function.

    13. Re:What? by sporb · · Score: 1

      See -> Perl::Troll

    14. Re:What? by castrox · · Score: 1

      Given that XML has become a bit of a standard in business, it makes sense to use it to be able to share data between applications written in different languages. Now, I don't know the status of YAML in e.g. Java or C++, but unless they have good parsers for it I reckon I'd choose XML for the task simply because it's sufficiently clear, people know how to use schemas, and so on.

      --
      Fight for your digital freedom, join the EFF *now*: http://www.eff.org/support/
    15. Re:What? by fatphil · · Score: 1

      No, you obviously don't understand, "Because XML is after all the standard for this sort of thing,"

      FatPhil

      --
      Also FatPhil on SoylentNews, id 863
    16. Re:What? by moonbender · · Score: 1

      Executing your configuration files? Worst idea ever. (Yes, I'm aware you offer an alternative. It's still... twisted.)

      --
      Switch back to Slashdot's D1 system.
    17. Re:What? by moonbender · · Score: 1

      Why are you using an XML parser within an inner loop? Or if you aren't, why are you benchmarking it? I still don't like XML, though, it's just not pretty.

      --
      Switch back to Slashdot's D1 system.
    18. Re:What? by fatphil · · Score: 1

      It looks like the IBM author is struggling with XML too:

      Listing 6. A few of our pets, pets.xml
      <?xml version='1.0'?>
      <pets>
          <cat>
              <name>Madness</name>
              <dob>1 February 2004</dob>
              <price>150</price>
          </cat>
          <dog>Maggie</name>
              <dob>12 October 2005
              <name></dob>
              <price>75</price>
              <owner>Rosie</owner>
          </dog>
          <cat>
              <name>Little</name>
              <dob>23 June 2006</dob>
              <price>25</price>
          </cat>
      </pets>

      I may not be an XML ultra-guru, but that looks just plain wrong. The tags' aren't correctly nested.
      e.g. <dog>Maggie</name>

      This wouldn't be the first time IBM has churned out a pile of codswallop in their developerworks pages. In fact I don't remember the last time I saw a good one.

      --
      Also FatPhil on SoylentNews, id 863
    19. Re:What? by Anonymous Coward · · Score: 0

      The OP didn't say Javascript had support for XML. Read it again, ah hell you're probably too lazy:

      "Most browsers have built-in support for processing XML"

    20. Re:What? by Anonymous Coward · · Score: 0

      I just searched Google for YAML:

      YAML Ain't Markup Language

      A straightforward machine parsable data serialization format designed for human readability and interaction with scripting languages such as Perl and ...

      YAML Ain't Markup Language? Call me when they grow up.

    21. Re:What? by bcrowell · · Score: 1

      Thanks for the pointers to YAML and JSON, both of which I thought were interesting. However, I think you're comparing apples and oranges in a couple of different ways. Benchmarking XML::Simple against YAML::Syck doesn't really make sense, because nobody is claiming that XML::Simple should be used on large files, or for performance-intensive applications; its claim to fame, compared to other XML parsers, is just its ease of use. JSON seems like a sensible format to use if what you're basically doing is serializing structs; XML is more sensible if what you're storing is essentially a marked up text document. It could also be an advantage in certain situations that JSON is parseable by a JS interpreter, and that's very similar to the advantage that lisp expressions might sometimes have over XML.

    22. Re:What? by Anonymous Coward · · Score: 0

      Beg your pardon? Quite often the stream of data from the XML IS the main loop of the app. If the whole point of the app is to read some (possibly huge) XML and do some fairly simple processing then the speed of the XML parser IS the thing that matters most. And whether you are reading chunks of the data in the loop or have to build a structure before the processing can even start is not that important, you may very easily spend most of the runtime parsing the XML. (Or paging because the huge maze of objects describing the XML doesn't fit into the main memory.)

  13. Re:Bah, who the hell still uses perl? by KermodeBear · · Score: 2, Funny

    As true as that may be, I have never heard of any other language be referred to as a "write only language".

    --
    Love sees no species.
  14. More like "XML for Simple Perl Developers"... by Anonymous Coward · · Score: 0

    who can't RTFM!?!!

  15. That would be in ebcdic by Anonymous Coward · · Score: 0

    More bullshit from the big blue
    Oh yeah, thats right, the Linux fanboy on some crazy patent free westworld trip!

    Perl is for guys who live with their mum

    Perl is for people who think how they think is how we all think
    AMPERSAND, WHY YES AMPERSAND!
    Of course you dummy

    XML?
    XML is some stuff one of those deranged geeks COULD decode if the shit hit the fan
    XML is the ANGLE BRACKET DAWN OF A NEW AGE; A NEW ROBOT AGE WHERE WE WILL LIVE IN TOTAL WORLD PEACE

    Perl was the fucking bastard son of AWK
    Perl is Sooo 1995
    Where the fuck is Perl 6?
    Oh quick bolt on some OOPS stuff, I got an interview with Sun Microsystems tommorrow
    Thats right Mr President sir, Perl will make our willys larger than Big Bad Bills
    WE WILL DRENCH THEIR FACES IN OUR SUPER CUM

    Fuck we can't give it away man, free as in out-of-date BEER

    PS Has anyone confirmed Perl is dead yet?

    1. Re:That would be in ebcdic by daeg · · Score: 1

      Your post reads like a badly written Perl script, albeit with less punctuation.

  16. Re:Bah, who the hell still uses perl? by Jah-Wren+Ryel · · Score: 4, Insightful

    As true as that may be, I have never heard of any
    other language be referred to as a "write only language".
    The only point that citing your personal ignorance makes is that you are ignorant.
    --
    When information is power, privacy is freedom.
  17. what a coincidence (re: XML::Tiny) by toby · · Score: 1

    I just today noticed the announcement of XML::Tiny.

    --
    you had me at #!
    1. Re:what a coincidence (re: XML::Tiny) by Saint+Stephen · · Score: 1

      Flame me if you want, but that guy's comments at the end of his README, and the link to his Wishlist page, are just too much. Chime in if you read it. /rolls eyes

    2. Re:what a coincidence (re: XML::Tiny) by Anonymous Coward · · Score: 0

      Not another one!

      Gurg, I can understand the usefulness of an all-perl implementation of an XML parser generator, but a number of them such as XML::Mini have existed for a looong time...

    3. Re:what a coincidence (re: XML::Tiny) by DrHyde · · Score: 1

      What comments at the end of my README? You object to the installation instructions?

  18. Re:Bah, who the hell still uses perl? by KermodeBear · · Score: 0, Flamebait

    Ah, and now I can say that I've only known three languages to be referenced to as write only - Perl being one of them (TECO and APL being the other two).

    Regardless, even though the reputation is a shared one that doesn't make it a good thing.

    --
    Love sees no species.
  19. Re:Are you serious? by Anonymous Coward · · Score: 0

    Why is there always so much Perl bashing that goes on here. You can make any languages code look like a steaming pile of crap. And honestly I probably had some of the same sentiments before I started my current job, where I've done quite a bit of development in Perl. Its the right tool for the job, and I do have to take a little extra time when writing my code to make it as readable as say Java or C++, but really not all that much more. Be a smart programmer and you wont have to worry about how ugly the code is, its only as ugly as the person writing it.

  20. hmm by XanC · · Score: 2, Informative

    It only claims to support a subset of XML, and of course it is called "Tiny", so I guess I can understand not supporting CDATA or attributes (...maybe). But for a ">" in a CDATA block to cause it to fail? It doesn't seem very useful.

    1. Re:hmm by orkysoft · · Score: 1

      It's still useful if you're only using it to read a limited kind of files, such as configuration files that were generated by the program itself. Of course, when the program needs to parse XML files generated by other programs, a more comprehensive module is needed.

      --

      I suffer from attention surplus disorder.
  21. A good tool for small tasks, but... by Scareduck · · Score: 2, Interesting

    ... utterly useless for anything of real size. XML::Simple is a huge memory sink, because, as mentioned elsewhere, it insists on generating full hash and array representations of the source XML text. This seems to be the side effect of taking too seriously a lot of Perl advice enthusiastically handed out in the older documentation. (Put file text into a huge array! Don't close your file descriptors!) The rest of us know better.

    --

    Dog is my co-pilot.

    1. Re:A good tool for small tasks, but... by localman · · Score: 1

      The rest of us know better.

      Hey now, it depends on the context. Sometimes it is good to just put text into a huge data structure. Sometimes it's not. In the end, a smart programmer who understands the issues is better than a rule.

      Cheers.

    2. Re:A good tool for small tasks, but... by Anonymous Coward · · Score: 0

      A maze of DOM objects has an even bigger memory footprint! ;-)
      And there's still lots of people that think it's best to parse the whole XML into a DOM tree and then work with that.

      Though just like sometimes it's not only easiest, but also most effective to slurp the whole file into a scalar or array, sometimes it's best to parse the whole XML and work with the result. It all depends on the task. Processing a 5KB config in stream mode looks like an overkill to me.

      In either case purely stream oriented libraries are hard to use so it's IMHO best to use something in between. Something that lets you handle individual twigs of the XML tree. XML::Twig or (in a bit unusual way) XML::Rules.

  22. Hello, AC by Scareduck · · Score: 2, Insightful

    There's a reason they're called "Cowards". Those of us who've been around a while know that there are all kinds of languages out there, and plenty of them can be used to write good code. The real problem with Perl is that Larry Wall is slowly losing his mind, adding features that nobody asked for; a good example is the new, backwards-incompatible regexps. (Don't go off that there'll be a compatibility mode; that's beside the point. The hubris needed to upend this core part of the language is pretty astonishing.) Also, he seems to be spending a lot of time with the Parrot rehosting, something else that is (perhaps) of dubious value. The changes are so orthogonal to what I do with Perl (hello, how about faster OO calls?) I have to wonder if there'll ever be a reason to switch to Perl 6. (Perhaps someone out there who knows more can comment.)

    --

    Dog is my co-pilot.

    1. Re:Hello, AC by nuzak · · Score: 4, Insightful

      > The hubris needed to upend this core part of the language is pretty astonishing.

      You mean like the first time he messed around with regexes? Now any regex implementation that doesn't have perl's features is considered a toy. And Perl is merely catching up to Snobol and Icon.

      Perl will do fine despite ignorant fools who sneer at it. Perl6 is still headed to perpetually unreleased oblivion, but some features will hopefully break off and find their way back into perl5 and elsewhere. Regexes among them.

      --
      Done with slashdot, done with nerds, getting a life.
    2. Re:Hello, AC by Watson+Ladd · · Score: 2, Insightful

      I think the regex syntax change is aimed at reducing the line-noise quality of regexes, as well as making them more expressive. The interpreter change is mostly aimed at pooling the skills of the Perl, Python, and Ruby communities. Even if it looks like a lot of effort now, it will pay off a lot later.

      --
      Inventions have long since reached their limit, and I see no hope for further development.-- Frontinus, 1st cent. AD
    3. Re:Hello, AC by VGPowerlord · · Score: 4, Insightful
      What I find annoying is that core language features are changing operators for no reason other than to change operators.

      Example: -> is changing to . The reason given is

      -> becomes ., like the rest of the world uses.
      Which also forces . to change to ~ (also .= is now ~=)
      Which also forces =~ to change to ~~

      That's three major operators in the language changed with the justification that the rest of the world does one of them differently. Except, by definition, people who already knew perl.
      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    4. Re:Hello, AC by larry+bagina · · Score: 1

      I was looking forward to perl 6 until I heard about that.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    5. Re:Hello, AC by chromatic · · Score: 2, Informative

      What I find annoying is that core language features are changing operators for no reason other than to change operators.

      The Apocalypses and Synopses (which somehow you managed to quote without reading the surrounding context) explain the reasons for the changes.

    6. Re:Hello, AC by chromatic · · Score: 1

      The real problem with Perl is that Larry Wall is slowly losing his mind, adding features that nobody asked for; a good example is the new, backwards-incompatible regexps. (Don't go off that there'll be a compatibility mode; that's beside the point. The hubris needed to upend this core part of the language is pretty astonishing.)

      I assume you've never used Perl 6 rules. I have. They are so much more powerful and usable than Perl regexes that they deserved a different name.

      Also, he seems to be spending a lot of time with the Parrot rehosting, something else that is (perhaps) of dubious value.

      No, he's not. That's Allison and Patrick and me. What gave you the idea that Larry worked on Parrot?

    7. Re:Hello, AC by VGPowerlord · · Score: 1

      Several operators have been given new names to increase clarity and better Huffman-code the language, while others have changed precedence.
      is not a strong enough justification to change operators in a non-backward compatible way. It takes everything you've learned and throws it out the window. What is the incentive to me, as a developer, to learn Perl 6 over another language, since I have to relearn everything from scratch?

      Also, why continue to call it Perl if the entire language's syntax changed? It would be like Microsoft calling what is now C# "Visual C++ 7," except that C++ has an ISO standard.

      P.S. I'm aware that Microsoft still makes Visual C++ and that the latest version is 8.
      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    8. Re:Hello, AC by Scareduck · · Score: 1

      You mean like the first time he messed around with regexes?
      No. Those were at least backward compatable. The new changes are backwards incompatible.
      --

      Dog is my co-pilot.

    9. Re:Hello, AC by chromatic · · Score: 1

      You keep using that word ("everything"). I do not think it means what you think it means.

      Why not try writing some Perl 6 code? I did that a couple of years ago. Perl 6 feels very perlish to me, even more natural than Perl 5.

    10. Re:Hello, AC by nuzak · · Score: 1

      The syntax of the perl language, including the syntax around regex literals, is incompatible. The syntax of the regexes themselves when you use the 'p5' option is exactly the same. I defy you to show otherwise.

      --
      Done with slashdot, done with nerds, getting a life.
    11. Re:Hello, AC by nuzak · · Score: 1

      I assume you've never used Perl 6 rules. I have. They are so much more powerful and usable than Perl regexes that they deserved a different name.

      Yeah, except as a sign of all the other pointless churn in Perl6, they're not called "rules" anymore. It's back to calling them regexes, even the new production-rule kind. No doubt it'll flip back to "rules" a couple more times this year.

      I love perl, but perl6 is doomed thanks to bikeshed-painting like this.

      --
      Done with slashdot, done with nerds, getting a life.
    12. Re:Hello, AC by Anonymous Coward · · Score: 0

      Wow. Really? That's a whole lot of code breakage for the sake of changing "->", which I have no problem with. It made sense ("->" *looks* like a reference). I'd be happy to use "." as an alternative, but with all the other changes implied if that is done, uh, no thanks. Not worth it.

      [Shrug] I guess I won't be using perl 6.

    13. Re:Hello, AC by VGPowerlord · · Score: 1

      You keep using that word ("everything"). I do not think it means what you think it means.
      You're right, there are some things that stayed the same. For example, prescript and postscript... assigning values to a variable (but NOT to an element of an array or hash, that syntax has changed)

      However, the list of what HAS changed appears to be much longer:
      Array manipulation, renaming operators, OO, Regex, the list goes on...

      Why not try writing some Perl 6 code? I did that a couple of years ago. Perl 6 feels very perlish to me, even more natural than Perl 5.
      To answer your question, there are several reasons, some not actually related to the way the code looks:
      1. The language is still subject to change.
      2. Libraries, libraries, libraries. Perl 5 has lots of them. Does Perl 6?
      3. I don't want to use a language that relies on a VM. If I did, I'd consider using C# or Java.
      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  23. Python: syntactiacally significant whitespace..... by fanatic · · Score: 2, Funny

    gack!

    --
    "that's not encryption - it's a new perl script that I'm working on..." - from some Matrix parody
  24. I came in here to say this by Wee · · Score: 4, Interesting
    Was exactly what I was going to say. I've used XML::Simple a lot, but only for reading in small documents, like config files. It works well for that. But I'd never use it on something that was bigger than, say, 100K. It's too slow and resource intensive. It does, however live up to its name. It's a very simple interface to an XML doc.

    One thing I user it for was representing a database in XML. Once I had the DB layout in a datastructure, it was one line to print it out. Of course, this was before I knew about DBIx::XML_RDB...

    -B

    --

    Ash and Hickory, straight-grained and true, make excellent bludgeons, dandy for the cudgeling of vegetarians.

    1. Re:I came in here to say this by faqmaster · · Score: 1

      I'd recommend XML::Twig for huge documents. I've used it to parse giant (700+ meg) files, on an underpowered desktop no less and in reasonable time.

      --
      Are you...Are you some kind of genius?
      No, ma'am, I'm just a regular Slashdot reader.
  25. Perl6 by fanatic · · Score: 1

    I'm hoping I die and/or retire before perl5 is discontinued.

    --
    "that's not encryption - it's a new perl script that I'm working on..." - from some Matrix parody
  26. 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.

  27. Simple is not good by MarkKnopfler · · Score: 2, Informative

    In my personal experience, Simple is probably the worst implementation of an XML parser in perl. For a simple implementation, I have found Twig to be much more useful, sensible and fast.

    1. Re:Simple is not good by filet0fish · · Score: 1

      Yeah, Twig rocks. I had to write a perl script about 2 years ago that parsed a 400mb xml file. I tried a bunch of libraries and ended up going with twig. It was by far the easiest way to parse a huge document like that.

  28. Hello Nuzak by symbolset · · Score: 1

    Nobody is supposed to remember SNOBOL. There was no SNOBOL.

    --
    Help stamp out iliturcy.
  29. Underestimating Java by GunFodder · · Score: 2, Interesting

    Perl is a good development language. I especially appreciate the transparency of scripting languages - if something goes wrong I can examine the source immediately. But I think you underestimate the power of Java. CPAN is good, but the resources available to a Java developer are even more extensive, thanks to the combined efforts of the major software players and the open source community. Java-specific development tools are leaps ahead of most other languages. When a serious amount of effort is required to solve an problem then it makes sense to invest time in a tool that make complex systems easier to develop and troubleshoot.

    1. Re:Underestimating Java by Anonymous Coward · · Score: 0

      If you think the resources available to Java are more extensive then you haven't really seen/looked into CPAN. I've used both. CPAN wins by sheer megatonnage.

  30. is this a strawman attack? by GunFodder · · Score: 1

    I agree that the article is pointless. XML::Simple is the oldest Perl XML library in existence, and there are better alternatives available. How does YAML::Syck hold up against XML::LibXML for performance? Is the syntax as easy to use as XML::XPath? Who else uses YAML? I don't want to invest my time in a data format that no one else uses.

    1. Re:is this a strawman attack? by cliveholloway · · Score: 1

      I don't know but I'm sure you can Benchmark them :) Even if no one uses it, your own apps will be faster. All depends what area you work in, I guess.

      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
  31. XML data structure serialization by barnacle · · Score: 2, Informative

    This is the same approach that is built-in to the qore language http://qore.sourceforge.net/.

    It makes it really easy to manipulate data in XML format.

    However, qore supports deserialization of mixed text and data and multiple out-of order elements, XML attributes (imagine parsing a docbook file for example), as well as serialization (conversion of a qore data structure to an XML string) with the same features.

    The same limitations regarding streaming input and very large files affect this approach, but in all other common cases, it makes it really remarkably easy to manipulate and create data in XML format using this approach.

    (Qore also supports JSON with the same approach -- serialization and deserialization between JSON strings and qore data structures...)

    thanks,
    David

  32. Re:Python: syntactiacally significant whitespace.. by Anonymous Coward · · Score: 3, Insightful

    Oh yeah, it's just the absolute end of the world. Just a total show-stopper. After all, who would want readable, maintainable, consistent-looking code in a large team? What a disaster!

  33. Thanks by goombah99 · · Score: 1

    Hey thank you for pointing this out. I did not know about this. JSON and YAML are pretty nice.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  34. XSLT can't do arithmetic? WTF? by johnny99 · · Score: 2, Informative

    The author of that article says you'll want to use the magic of perl and XML::Simple because "XSLT can't do arithmetic" and proceeds to do magical things like increase numbers by 20%.

    That's just ... bizarre. Of course you can do that with XSLT! <xsl:value-of select="whatever * 1.2">

    Then he formats a number -- because XSLT, of course, doesn't have a format-number() function.

    Next article -- why you should commute to work in an airplane because, as everyone knows, cars can't turn corners.

    1. Re:XSLT can't do arithmetic? WTF? by ACORN_USER · · Score: 1
      Agreed, it's BS to say you can't do arithmatic in XSLT, however, YOU SHOULDN'T.

      Your stylesheet should be just for your data transformation and you don't want to be programming any complex logic into your stylesheet - unless you have to. I've seen (and written) some ugly ones and further, you don't want to be calling code from the stylesheet, which you can (depending on the xslt processor), but shouldn't - unless you have to.

      Keep your stylesheets simple. They are useful, but complex logic will bloat them and it's a lot more performant to put such processing in code.

  35. Re:Python: syntactiacally significant whitespace.. by Anonymous Coward · · Score: 0

    http://www.bartleby.com/100/420.47.html

    Consistency is great... if all your code does the exact same thing, the exact same way. Otherwise, it can be misleading, and the ability to express differing functions in differing formatting is an indispensable boon to clarity.

  36. Indeed. by Ayanami+Rei · · Score: 2, Insightful

    Java is well-suited for large projects with fairly well defined requirements (and potentially complex interactions between objects/components).

    If the requirements are ill defined, or the system small enough to likely be confined to a single box, or the object model relatively simple (few types, lots of instances) then perl is the first thing I think of...

    Unless the object model is regular and layered, then I think ruby.
    Unless there is a need for blistering IO and syscalltastic goodness with function overloading, then C++
    Unless there isn't a need for too many object tricks or the STL, then C.

    All of the above languages have excellent tools, environments, and libraries. I think they've all got it made in the shade.

    BTW, the easiest language to develop and troubleshoot is JavaScript (ecmascript). Tools like firebug make it stupid-easy. Of course, there's no regularized non-web environment for it; I've seen small efforts to that end but they always end up not going far. It's a real shame, IMHO. Prototyping, lazy-evaluating, duck typing, easy-to-read language... what's not to love?

    I don't know *kicks dirt*

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  37. Re:Bah, who the hell still uses perl? by Anonymous Coward · · Score: 0

    No, professionals don't work as a software programmer/engineer/whatevertitleyouwanttoglorifyi twith, that is a blue collar job nowdays :) Get with the times, move on :)

  38. XML??? Binary is faster! by mrnick · · Score: 0, Offtopic

    These comments are based on C++, though i have used Perl I have been doing much more C++ coding lately.

    The XML files are text based. Text I/O has to be read in sequentially whereas you can write out an entire block of allocated memory to the disk in binary format. The advantages of this is that you can read & write that data to and from disk 50 to 100 times faster than reading it in sequential from a text file.

    What advantages does XML provide at the expensive of data i/o speed loss?

    Nick Powers

    --

    Encryption: I may not agree with what you say, but I will defend your right to encrypt it...
    1. Re:XML??? Binary is faster! by Mr.+Droopy+Drawers · · Score: 1

      Can't tell if this is a joke or if you're serious. ASCII-based formats solve the issue of data transmission between two unknown sources.

      binary formats suffer from the issues of data representation and Endian-ness. Are your Integers 64-bit or 32-bit? Did you write your values with a Power-PC or with an Intel-based processor?

      Like it (or not), XML is becoming the defacto standard for data representation. I'm dealing with this in embedded CIM implementations. Are there better parsable formats? Possibly. But none that are so universally accepted.

      As they say, "The great thing about standards is there's so many to choose from!".

      --

      To Copy from One is Plagiarism; To Copy from Many is Research.

    2. Re:XML??? Binary is faster! by crucini · · Score: 1

      ASCII-based formats solve the issue of data transmission between two unknown sources...
      Indeed. XML is great at bridging gaps. Programmers with very different languages, platforms and viewpoints can exchange it. However, I've become increasingly aware of the space and time hit. Which depends, of course, on the app.

      Actually, as long as the sender and receiver are in C, XML has not been the bottleneck for me yet. I do have one Perl XML sender (using XML::Simple) which is a bottleneck.

      One way to solve the endianness problem is with the functions in byteorder(3). Another is to prefix a sentinel word and have the receiver swab(3) as needed if the word is reversed. That makes a lot of sense if 99% of boxes are x86.
  39. Re: XML??? Binary is faster! - yeahyeahyeah by Anonymous Coward · · Score: 1, Insightful

    These comments are based on C++, though i have used Perl I have been doing much more C++ coding lately. Me too a C++ programmer - using xml extensively.

    The XML files are text based. Text I/O has to be read in sequentially whereas you can write out an entire block of allocated memory to the disk in binary format. The advantages of this is that you can read & write that data to and from disk 50 to 100 times faster than reading it in sequential from a text file.

    What advantages does XML provide at the expensive of data i/o speed loss? Most xml parsers I have used had the option to read the complete file into memory in large chunks, and perform the actual parsing on the memory stream. So there is no performance penalty compared to binary file loading in terms of I/O.

    The actual performance penalty comes from the actual parsing, which is of course slower than just memcpy()'ing memory-ready binary data into place. I have spent a whole lot of time on this performance issue and have found (the hard way) that the key to speeding this up lies in optimizing the xml document structure. Take it as a given that most xml tutorials advocate sub-par structure for the sake of simplicity.

    Take a look at https://collada.org/public_forum/welcome.php for a good optimized xml-based format.

    regards,

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

    Whatever. If 80K for a hack (and that's what I am; a hack and thoroughly mediocre) is 'blue collar' well then, call me blue collar. Beats flipping burgers.

  41. There's nothing wrong with Perl by Anonymous Coward · · Score: 0

    I've used Perl for a while now, and I've done some work on C#. Frankly speaking there isn't any library I see available in C# that can parse simple XML documents as simply and quickly as XML::Simple.

    Guys, most of the time there's really no point talking about how much faster lib X is, or how lib Y is yada yada...Perl and XML::Simple does the job. Does it fast, does it CLEANly, and lets the overworked developer move on to the next job.

    That's life. Get real.

    1. Re:There's nothing wrong with Perl by miletus · · Score: 1
      I don't get the Perl bashing. Sure, the syntax has a lot of stuff that's irrelavent if you don't come from a UNIX/shell background, and sure, it can be cryptic

      I try to keep my code as readible as possible, and when I do write something that's rather dense and "Perlish", I comment it. But CPAN is what keeps me in Perl; there's just too much there to easily give up.

      I'm sure Python and Ruby, etc. are great languages, but I see no compelling reason to give up Perl just yet. I'm on the fence with Perl 6 -- if Parrot allows CPAN modules to be used by other scripting languages, I might learn Ruby if I can leverage existing Perl modules.

  42. Nice for simple data translation by SCHecklerX · · Score: 1

    I used XML::Simple in a script I wrote to grab data from my garmin GPS to use at http://www.gpsvisualizer.com/ Worked great without a lot of extra stuff to learn for a simple task.

    1. Re:Nice for simple data translation by adamschneider · · Score: 1

      Funny you should mention that, because GPS Visualizer makes pretty heavy use of XML::Simple to read several XML-based GPS data file formats -- GPX, Garmin Forerunner, LOC, etc.).

      (Unfortunately, I wasn't able to use it to create GPX files, because apparently the order of the tags is significant, and XML::Simple doesn't let you set the order.)

  43. Once again blocked by the install instructions ... by jc42 · · Score: 1
    I'd looked into XML::Simple some time back, and gave up because I couldn't successfully install it. So again I went through IBM's install instructions, starting with that "perl -MCPAN" command, which of course told me at the start that I already had a ~/.cpan directory. Anyway, it seemed to be going ok until the "make install", which ended with:

    Running make install
    Warning: You do not have permissions to install into /usr/local/lib/perl5/site_perl/5.8.8/mach at /usr/local/lib/perl5/site_perl/5.8.8/ExtUtils/Inst all.pm line 114.
    mkdir /usr/local/lib/perl5/site_perl/5.8.8/XML: Permission denied at /usr/local/lib/perl5/site_perl/5.8.8/ExtUtils/Inst all.pm line 176
    *** Error code 13

    Stop in /u/guests/jc/.cpan/build/XML-Simple-2.16. /usr/bin/make install -- NOT OK
            You may have to su to root to install the package
    I don't have root access on the machine I was using, which is where my main web site is. So this looks like brick wall. I'll dig around a bit more to see if there's a way to install the thing as a non-su user. But as before, I'll probably fail. A brief look at the install stuff shows that it's quite an impressive horror.

    I'm a bit leery of installing it on a machine where I do have root access. The incomprehensibility of the install code, plus the fact that it comes from IBM (which may be a bit better than MS, but does have a bit of history ;-) makes me very nervous about trusting something that wants the root password on my machine.

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  44. Re:Bah, who the hell still uses perl? by pilkul · · Score: 1

    Oh boo hoo, he hasn't heard of these two random other languages, one of which is obscure and the other long-dead. He must really be an incompetent fool: anyone who wasn't around in the days of TECO is. What was your point again?

  45. Re:Bah, who the hell still uses perl? by Jah-Wren+Ryel · · Score: 1

    My point was that proof by regurgitated insult isn't any proof at all.

    --
    When information is power, privacy is freedom.
  46. alternative by Anonymous Coward · · Score: 1, Funny

    XML::Gay

  47. Re:Bah, who the hell still uses perl? by Lord+Ender · · Score: 1

    I code in Perl for a living. I code in Python and Ruby for fun.

    While many languages have excess baggage (like semicolons) simply because their designers didn't want to stray too far from the languages that inspired them, Perl is the only language out there that is made up entirely of this baggage. It's a Frankenstein's Monster of dead language ideas.

    Also, Perl, above all other languages I have used, Perl seems to have been been designed with the philosophy "complexity is good." Today, this philosophy is almost universally recognized as being completely backward in the software engineering world.

    Perl's criticism is well-deserved. The only real advantages of Perl over the other high level languages in its space are execution speed, availability of skills, and a large module library. It doesn't take a genius to realize that Perl's lead in these areas is shrinking rapidly.

    And if you agree that complexity is bad, surely you realize that Perl encourages it, while the other languages do the opposite.

    --
    A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
  48. No, XSLT doesn't count by Dion · · Score: 1

    XSLT is disqualified because it's impossible to do anything of any complexity in it without going insane.

    Not only is the syntax horendously complex, but there are major misimplemented features that force strange and illogical workarounds, but people used to real programming languages have a really hard time grasping the template style leading to even more frustrations.

    XSLT is a complete paradox, on one hand it's supposed to let non-programmers manipulate xml, but at the same time it's so hard to use that programmers can't use it.

    I'd rather use a real programming language that I already know and manipulate the data with that, thank you very much.

    --
    -- To dream a dream is grand, but to live it is divine. -- Leto ][
  49. Re:Are you serious? by doom · · Score: 1

    Why is there always so much Perl bashing that goes on here.

    Because you see, despite the fact that programmers like to pretend that they're supremely rational they're actually as faddish as a bunch of teenagers.

  50. ++XML::Twig by Dotan · · Score: 1

    Yep, XML::Twig is the thing to use - gives you the efficiency of a stream/event based parser and the convenience of DOM/XML::Simple style access.
    XML::Simple is a toy in comparison.

  51. Re:Bah, who the hell still uses perl? by chromatic · · Score: 1

    And if you agree that complexity is bad, surely you realize that Perl encourages it...

    I don't realize that. Can you explain?

    All I know is that it's impossible for Chinese people to communicate because someone who never learned the pictographs can't write a post-modern novel within a week of starting to learn Mandarin.

  52. Re:Once again blocked by the install instructions by chromatic · · Score: 1

    See the INSTALL_BASE argument to MakeMaker.

  53. Re:Once again blocked by the install instructions by jc42 · · Score: 1
    Well, that didn't work too well. When it asked for args to "perl Makefile.PL", I gave it INSTALL_BASE=~, and then when it got around to running the command, it said:

    'INSTALL_BASE' is not a known MakeMaker parameter name.
    It then proceeded to attempt installing in the system libraries, and failed again because I wasn't root.

    I wonder what's going on here?

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  54. Re:Python: syntactiacally significant whitespace.. by Blackknight · · Score: 1

    Not to mention you'd probably indent the code in any other language, python just gets rid of the extra braces.

  55. Perl supports comments... by patio11 · · Score: 2, Interesting

    ... as one of more than one ways to do things. Unfortunately, every Perl program I have seen (with the merciful exception of POPFile) picks one of the other ways. TMTOWTDI, don't you know.

    The problem with Perl isn't the language. OK, let me amend that: s/ (t)/just $1/. Its that the culture which surrounds the language encourages practices which are at odds with maintainability. You can't seperate Perl code from Perl coders, and Perl coders are, to a disturbing degree, prone to creating unmaintainable cruft with copious use of syntatic sugar which is actually disguised cyanide. Perl would be better off if some things which are syntactically allowable were banned forever. Here's a couple:

    * copious use of default parameters (a wonderful way to introduce bugs into the program by accidentally overwriting one when inserting a new line of code between two sections of code which do not look obviously related)

    * $_.=$& Code this obtuse needs to be discouraged, not encouraged. Its powerful, but totally obtuse, and programmer brain time is more important than finger time, which unfortunately Perl has decided to optimize for. (Incidentally: it appends the last regular expression match to whatever string you were operating on. I think.)

    * Multiple methods of passing arguments to functions. (I have come across code which uses more than three in a single source file.) Function prototypes are like seatbelts. I know you think you're smart enough to not cause an accident. Statistically speaking, you're not. Buckle the heck up.

    1. Re:Perl supports comments... by Anonymous Coward · · Score: 0

      I think.

      No you don't.
    2. Re:Perl supports comments... by Anonymous Coward · · Score: 0

      I think we've seen very different parts of the community. Not sure what does it tell about you. Yeah, there's a lot of crap written in Perl. What it means though is that 1) even crap can get the job done and 2) there's a lot of Perl. There's a lot of crap in any language, but the Perl one seems to get all the attention. I guess because the (censored) that see the language for the first time get thrown off by the sigils ($scalar, @array, %hash), decide that it's unreadable (even though they actually help readability once you get used to them) and go ahunting for examples to prove their point. I guess there must be something good about Perl if they feel the need.

      And BTW "separate", not "seperate".

  56. Re:Once again blocked by the install instructions by chromatic · · Score: 1

    You need a fairly recent version of ExtUtils::MakeMaker. Perhaps upgrading that (as root) will help. Otherwise, the PREFIX option exists in older versions, but it doesn't work the way almost everyone assumes it does.

  57. Re:Python: syntactiacally significant whitespace.. by DrVomact · · Score: 2, Interesting

    Not to mention you'd probably indent the code in any other language, python just gets rid of the extra braces.

    Yeah, but once you screw up the indents in a whole file of Python source, you're not going to think that this is such a great thing. See, if you accidentally flatten out the indents of Python code, you have no clue where blocks used to begin and end. If the same thing happened in Perl, you could easily straighten things out by using the curlies as cues. (Heck, my editor will fix indents automatically for Perl.) This actually happened to me once--I accidentally sucked out all the leading spaces of every line of a Python program. The resulting mess made me re-think my infatuation with the language.

    Having tried Python and having used Perl for years, I can't think of any reason why we need Python. Seems to me that anything you can do in Python you can also do in Perl. The reverse may be true, but ask yourself...does the world really need another programming language? I'm not going to be fanatic about it...use anything you think will do the job. But I'm not going to be using a language that gets upset if my indents are a off by a space, and that runs counter to my intuitive perception that white space is syntactically meaningless.

    --
    Great men are almost always bad men--Lord Acton's Corollary
  58. Re:Bah, who the hell still uses perl? by Archibald+Buttle · · Score: 1

    Many businesses consider C and C++ to be "write only languages" and ban it's use in custom applications encoding business logic.

    I personally know of far more businesses that consider C/C++ to be "write only" and consider Perl in the same way.

  59. Re:Python: syntactiacally significant whitespace.. by jc42 · · Score: 1

    Not to mention you'd probably indent the code in any other language, python just gets rid of the extra braces.

    Yeah, but once you screw up the indents in a whole file of Python source, you're not going to think that this is such a great thing. See, if you accidentally flatten out the indents of Python code, you have no clue where blocks used to begin and end.


    Yeah; I've seen quite a bit of this problem from my experiments with python. Usually, it comes about when trying to exchange code via email. Lots of email software plays fast and loose with white space, not to mention the nasty problems caused by line wrapping. Getting python code safely through via email can be a real challenge. Undoing the damage for more than a few lines of code can give you a headache. It's a lot easier with languages that don't use white space syntactically; you just feed it to a "prettyprinter" and it's good again.

    Of course, the real solution would be to round up all the idiots who write email software that munges the format of the text, take them out back, and work them over a bit. I've found that rational argument doesn't work with this crowd. They seem to think that it's perfectly acceptable for email software to "improve" the text by rewriting white space, and nothing you can say convinces them otherwise. Even more recalcitrant are the folks who like to convert email between plain text and HTML.

    It doesn't even work to just put files in a web directory and tell people to download them. They usually do this with a browser, and lots of browsers will rewrite white space (especially tabs) and do line wrapping in with text/plain and <pre> parts of HTML files, and there's no way to prevent this.

    In a few cases, the only way we've found to prevent irrecoverable damage to python code is to encrypt the text with some simple tool like uuencode, and decrypt it at the receiving end. It's a PITA for what should be a simple file copy, but it works.

    With (nearly) fully-parenthesized languages like C and perl, most such damage is usually easy to undo. With python, it can be nearly impossible, because the block structure is simply gone.

    Of course, this is only a problem if you're trying to share code with others. As a language for in-house, unshared code that never has to be transmitted to anyone else, python is probably fine.

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  60. Re:Are you serious? by Fastolfe · · Score: 1

    That, or the self-described programmers posting on Slashdot really are a faddish bunch of teenagers.

  61. Is this a new post? by tthomas48 · · Score: 1

    Hasn't everyone already heard of XML::Simple? Or are we pointing out again the reason why I stopped using perl? The fact that 99% of perl developers always reinvent the wheel rather than using CPAN.

  62. Re:Once again blocked by the install instructions by Intron · · Score: 1

    To install local CPAN modules, see:
    http://sial.org/howto/perl/life-with-cpan/non-root /

    --
    Intron: the portion of DNA which expresses nothing useful.
  63. Re:Are you serious? by chromatic · · Score: 1

    s/Slashdot/the Web/
  64. [XML Simple]I used to love her, but now I hate her by ACORN_USER · · Score: 1
    I have serious issues with XML::Simple and what it does for Perl. Sure, like everything Perlish, it makes life easier so that develoepers can quickly knock up code which performs their required task. Even bad ones. That's great. It's great if you don't know what you're doing, but it's also dangerous for the world of perl development in general.

    This is my big gripe with XML::Simple. I've been using XML as protocol for dataexchange for a number of years in a number of languages and I do a great deal of Perl. I love XML::Simple when I'm parsing a very simple configuration file or a tree which is not very deep. However, it makes life so easy, that I've seen people munge in huge files with Simple, where a sax parser should have been used. I've seen people marshal out XML, when they don't understand the underlying schema - or even that such a concept exists.

    A little knowledge is a dangerous thing and a (way too) powerful API is even worse. There are way too many daft Perl projects and implementations out there (in the commercial world) for this very reason. It almost makes me loath the language I love so much.