Christmas quiz 2010

Chris Jack chris_jack at
Tue Dec 21 18:14:10 GMT 2010

Well the quiz obviously went down as well as the proverbial lead balloon, but I thought I should publish some answers anyway. Apologies for the loss of formatting in the perl code - it's formatted when I sent it. Oh and merry xmas:

questions based on
1) What does "Tim Toady" refer to?
It's the pronounciation of the acronym: there's more than one way to do it

2) What does this output?
for (qw( Huex Dewex Louid )) {
Doesn't compile as attempting to alter a constant

3) What year was Perl first released in?

4) If the following was a complete perl program, would it initialise %hohoho.
What statements could you add to verify this?

my %hohoho;
if ($hohoho{Robot}{Santa}{Claus} eq "sleigh") {
  print "Coming to town\n";
%hohoho gets initialised.
my %hohoho;
print scalar(%hohoho) ."\n";
if ($hohoho{Robot}{Santa}{Claus} eq "sleigh") {
  print "Coming to town\n";
print scalar(%hohoho) ."\n";

5) What version of Perl 5 introduced the given/when constructs?

6) What does the following output?
print scalar((a,b)) . "\n";

7) What is Perlscript?

8) What does the following output?
sub parent {
  print "Perl 4\n";
  print "Perl 5\n";
sub child {
  my(@a) = (@_);
  for my $i (@a) {
    print "$i\n";
Perl 4
Perl 5

9) In December, what will the localtime function report the month as?

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

More information about the mailing list