Christmas quiz 2010

Chris Jack chris_jack at msn.com
Wed Dec 15 18:27:55 GMT 2010


Questions based in part on http://www.onyxneon.com/books/modern_perl/modern_perl_a4.pdf

1) What does "Tim Toady" refer to?

2) What does this output?
for (qw( Huex Dewex Louid )) {
  $_++;
  print;
}

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";
}

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";
  &child;
  print "Perl 5\n";
  child;
}
sub child {
  my(@a) = (@_);
  for my $i (@a) {
    print "$i\n";
  }
}
parent(1,2);
 
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 london.pm mailing list