I've been working on learning Perl now off and on for a few days. Nothing very serious, but it's an important language to know if you have to automate things or write web applications. What makes the language hard to learn is that there seems to be an infinite number of ways to do the same thing in Perl. It's probably no coincidence that the guy who wrote it, Larry Wall, is into Aikido (according to the last interview I saw with him) because like Aikido, it's as much a style of doing something as it is a specific way of doing something. Despite being so open-ended, it's got some really simple features like the XML::Simple package for XML processing. I couldn't do something like this in Java:
use XML::Simple;
my $xmlsim = XML::Simple->new();
my $xml = $xmlsim->XMLin("./test.xml");
print $xml->{question}[0]->{text} . "\n\n";
print $xml->{question}[1]->{text} . "\n\n";
print $xml->{question}[1]->{response}[1]->{weightTo} . "\n\n";
<poll>
<author>MikeT</author>
<startTime>5/1/2007 12:58:00</startTime>
<endTime>5/1/2007 15:58:00</endTime>
<title>Where should you live?</title>
<question>
<text>Do you like your life to be complicated, serene or halfway in between?</text>
<response weightTo="Big City">I love living life in the fast lane!</response>
<response weightTo="Suburbs">I like working in big cities, but wouldn't want to live there.</response>
<response weightTo="Beach">I like a more relaxed environment, but still need some surprise to be happy.</response>
<response weightTo="Plains">I like life to be no more complicated than knowing what I'm going to do today.</response>
</question>
<question>
<text>Do you need to be surrounded by nice things?</text>
<response weightTo="Big City">Yes!</response>
<response weightTo="Suburbs|Beach">Not really.</response>
<response weightTo="Plains">What? I ain't greedy!</response>
</question>
<result>
<for>Big City</for>
<text>You need to live in the big city. You can't stand a lifestyle that isn't fast paced and exciting.</text>
<graphic>/graphics/bigcity.png</graphic>
</result>
</poll>
I'd prefer to be using DOM for this plugin for Movable Type that I am slowly working on because DOM is more object-oriented by design, but this is close enough. There are many reasons to complain about Perl, all of which really have to do with how open-ended the language is, but you have to give the Perl monks credit for creating APIs that are this simple and accessible to newbies.
And yes, I did base that XML on what I would imagine you would need to recreate one of the polls from blogthings.