Perl Christmas Quiz 2009

Dave Cross dave at
Mon Nov 30 19:38:31 GMT 2009

On 30/11/09 18:24, Chris Jack wrote:

> In-Reply-To: < at>
> References: < at>


> ------------
> 1) Without running it to check, what does the following program output?
> my %a = (3,2,1,0);
> for my $b (sort values %a) {
>      $b += 4;
> }
> print $a{1} . "\n";

Without running it, I'd say 4. Having now run it, I'm glad that's what I 
said :)

> 2) If you received a perl mongers award for contributions to the Perl
> community, what colour/type of camel would the award be?

There are quite a few people on this list who have insider knowledge here.

> 3) What is Perl XS? What does XS stand for?

It doesn't _stand_ for anything. It's short for XSUB which, in turn, is 
short for (I'm guessing) eXternal SUBroutine.

> 4) Based on your answer to the previous question, what do you conclude about
> Perl programmers spelling ability?

I think this leads to theories about "perl programmers'" spelling 
abilities, rather than "Perl programmers'" spelling abilities. There's 
an important difference.

> 5) Write a short perl program that has a memory leak. Bonus mark for one line
> solutions. Second bonus mark for the shortest program.

Sorry but it's a matter of professional pride that I _never_ write code 
with memory leaks - honest!

> 6) What is the name of the official Soft Toy Camel of the London Perl Mongers?
> Bonus mark if you own one.

According to the Beanie Baby people, he's called Niles. According to us 
(and the 2001 leadership election ballot papers) she's called Amelia.

> 7) Write a one line program that takes a non-negative integer as an argument
> and prints the square root when the answer's an integer.
> Restrictions: the perl line should be a regular expression.
> You are allowed to use the following functions/operators "x", "-", "length",
> "print" plus any of the usual regular expression bestiary.
> Hint: Consider converting the number to unary.

I'll leave that to the golfing experts.

> 8) According to, what is the best selling Perl book so far in 2009?

Does Amazon give an annual sales chart? I thought they just showed a 
current "sales" chart.

Current top of that chart is the Perl Template Toolkit book (or, rather, 
it will be once you've all bought copies as christmas presents for all 
your friends and family).

> 9) What is the link for the perl v other languages videos
> discussed on this list, and also the bubble sort video?

I must have missed those discussions.

> 10) What is the highest value of X that is a currently available, stable
> production release of perl 5.X?


> 11) Think of a witty and/or interesting Perl Christmas quiz question and
> answer it.

What was the most embarrassing Perl web site launch of 2009?!



More information about the mailing list