Chapter 35. The Perl Whirl Quiz Show

Jon Orwant

This is the quiz show that I wrote in 2000 for Neil Bauman’s inaugural Perl Whirl, an Alaskan cruise that was also a Perl conference. The rules were the same as for my O’Reilly quiz shows, but since I couldn’t attend the cruise, Larry Wall stepped in as emcee. (For more information about Perl Whirls and other geek cruises, see http://geekcruises.com.)

You know the drill by now: one point per question, and calculate your score with the chart at the beginning of Chapter 31.

Toss-up Questions

Toss-up 1: Slashdot publicized a web server powered by an unlikely source. What is this starchy vegetable?

Toss-up 2: Fill in the blank: John Gilmore said, “The Net interprets _________________ as damage and routes around it. What is this term, synonymous with “restraint of expression”?

Toss-up 3: What is the name of the default package in Perl?

Toss-up 4: “I rescue kegs,” “creek guises,” and “Gee! Sick user!” are all anagrams of what phrase that should presumably be familiar to us all?

Toss-up 5: What special scalar variable contains the time at which your program began running?

Toss-up 6: The GD module used to use GIF as its primary image format, but thanks to Unisys enforcing its patent on LZW compression, GIF is no longer feasible. What image format does GD use now?

Toss-up 7: Which character is the modulus operator in Perl?

Toss-up 8: This proponent of literate programming uses an assembly language called MIX in his well-known computer science books. Who is this Stanford professor and inventor of TeX and Metafont?

Toss-up 9: What special array inside a class contains the list of classes to inherit from?

Toss-up 10: It lets you search CPAN for simple patterns in module names, distribution names, author names, or documentation. What is the URL of this relatively new and incredibly useful web site?

Toss-up 11: Its pits are half as long; it has two layers instead of just one; its tracks are half as thick. You can read data from it about nine times as fast as from an audio CD. What is this medium?

Toss-up 12: What four-letter HTML tag encodes information about the content of a web page, often used for inform (or fool) search engines?

Toss-up 13: Guess that file test. With this file test, your program can determine whether it was called interactively. More precisely, you can use this file test to see whether a filehandle is a tty, and if both STDIN and STDOUT are ttys, your program can be pretty sure it was called from a shell. What is this single letter?

Toss-up 14: It’s a Brazilian dance of African origin characterized by a dip and spring upward at each beat of the music. What is this two-syllable word, which also names a product enabling Unix and Windows machines to share directories and files?

Toss-up 15: What Perl built-in terminates your program and launches another one in its place?

Toss-up 16: Support for this standard is being introduced into Perl. The standard provides a unique number for every character, no matter what the platform, no matter what the program, no matter what the language. What is this character encoding standard?

Toss-up 17: If you were looking for modules that let you FTP, send mail, and Telnet, you could find them all in this three-letter namespace on CPAN. In other words, I’m looking for the BLANK in BLANK::FTP, BLANK::TELNET, and BLANK::SMTP. Fill in the blank.

Toss-up 18: This unlikely investor in an Internet startup spends her spare time knighting people and tugging around those darn Corgis. Who is this ruler of the British empire?

Toss-up 19: The fork function clones your program as it’s running; it’s like coming to a fork in the road, and choosing both. How can you tell which road you’re on?

Toss-up 20: What virus has functions named spreadtoemail and infectfiles?

Toss-up 21: This module bundled with Perl does little more than provide a hash. But what a hash: it contains entries that tell you how your Perl was compiled, what operating system you’re on, what signals your system understands, and whether your Perl was compiled with thread support. What is this module?

Toss-up 22: The first of these systems was a cluster of 16 DX4 processors connected by 10-megabit Ethernet. The processors were too fast for a single Ethernet, so new Ethernet drivers for Linux were created that striped the traffic across multiple Ethernets. What is the name for these supercomputing clusters of Linux systems, named after the slayer of Grendel?

Toss-up 23: Perl’s delete built-in doesn’t delete files. What six-letter built-in does?

Toss-up 24: A Perl cryptosystem code-named “Pontifex” appears in this novel. What is this large book by Neil Stephenson?

Toss-up 25: What three-letter pragma would you use to have your Perl program search for modules in particular directories? For instance, you’d say use __________ “temp” at the top of your program to have Perl look for modules in the temp directory. Fill in the blank.

Toss-up 26: When an XML document is validated, one says that it is validated against a __________. Fill in the blank.

Toss-up 27: Guess that function. Which built-in Perl function, given a file, tells you the inode of that file? This four-letter function also tells you the size of the file and when it was created. Name this function.

Toss-up 28: What is the four-letter name of the database manager bundled with Perl?

Toss-up 29: What special scalar variable defaults to 60, and contains the page length of the currently selected output handle? Name this punctuation variable.

Toss-up 30: It increases IP addresses from 32 bits to 128 bits, anticipating future growth of the Internet and providing relief for an impending shortage of network addresses. It provides for unicast (one host to one other host), anycast (one host to the nearest of multiple hosts), and multicast (one host to multiple hosts). What is the name of this new version of the Internet Protocol?

Toss-up 31: This little-known document lists all of the modules that have been installed into your Perl distribution. Its nine-letter name contains the name of the Perl function that provides dynamic scoping. Name this document.

Toss-up 32: When programmers tie a variable to a class, they often ignore the object returned by the built-in tie function. What is the built-in Perl function that lets you retrieve the object after the tie has taken place?

Toss-up 33: The Astro::SunTime module, available on the CPAN, calculates sunrises and sunsets. In what month is the latest sunrise in Alaska?

Toss-up 34: The -T command-line switch makes your program pay special attention to data arriving inside your program from the outside world. Such data is said to be until you convince Perl it’s now safe, often with a regular expression. Fill in the blank.

Toss-up 35: In new versions of Perl, you can declare a subroutine’s return value to be modifiable. For instance, if the subroutine is named foo, you’d be able to say foo(6) = 720, or foo(“color”) = “blue”. This is accomplished by placing a particular word after the subroutine name in its declaration. What is that word?

Toss-up 36: It’s a kernel written in Perl that lets you schedule events, and it’s also the last name of the poet who wrote “The Raven.” Name this three-letter word.

Toss-up 37: On a system using the U.S. English locale and a plain ASCII character set—in other words, what most of us use right now—how many different characters can w match inside a pattern? Identify this integer, one less than a perfect square.

Toss-up 38: Once you’ve opened a file, this Perl function lets you move to an arbitrary position inside it. What is this function, which takes three arguments: the filehandle, a position, and an offset?

Toss-up 39: The Astro::MoonPhase module, available on CPAN, calculates phases of the moon. What word describes our moon when it appears more than half full, but not completely full?

Toss-up 40: This built-in function should probably have been called wantlist. What is the name of this Perl function, which can be used to determine whether your subroutine was called in a scalar context or a list context?

Toss-up 41: “Generate Regular Expression and Print” is widely claimed to be the expansion of this odd word, which is both a Unix utility and a Perl function that selects particular elements from a list. Name it.

Bonus Questions

Bonus 1: Suppose you’re using the DBI module to manipulate an Oracle database from Perl. What module containing Oracle-specific information would you also need?

Bonus 2: Fill in the blank to complete a well-known saying about the Internet.

On the Internet, no one knows you’re a BLANK.

Bonus 3: Take the current four-digit year and assign it to a scalar. Chop it, chomp it, and chop it again. What does that scalar now hold?

Bonus 4: I’ll give you six anagrams of Perl keywords; you give me the keyword.

  1. Unlit

  2. Eval Us

  3. Mites

  4. Mopes

  5. Cute Rant

  6. O Torch

Bonus 5: Itanium is one of a new family of 64-bit microprocessors from Intel that has begun to appear in new computers. Name the processor family.

Bonus 6: Within ten percentage points, what percentage of new domains ended in .com in 1998?

Bonus 7: I’ll give you four operators that might or might not be in Perl. After each, you tell me whether it’s in Perl 5.6, yes or no.

  1. ~

  2. ^^

  3. |||

Bonus 8: To access the last element of an array called @foo, you could use the index $#foo. But you could also use what integer?

Bonus 9: This mod_perl module lets your web server send different content depending on the speed of the connection. The module name has two words separated by a double colon. The first word should be easy to guess, and the second word names an object you’d find in an airplane cockpit. Name the two words.

Bonus 10: What two characters do you put in front of a string to make Perl interpret the string as a hexademical number?

Bonus 11: Name that Palm Pilot. I’ll give you three types of Pilot, and you identify the model.

  1. This Pilot provides wireless Internet access.

  2. This Pilot is thinner than the rest.

  3. This Pilot is full color.

Bonus 12: RSA and Diffie-Hellman are examples of what kind of cryptography in which certain keys are made available for everyone to see?

Bonus 13: Eric Raymond coined this phrase, which divides software projects into two categories: those carefully crafted by a small number of people in isolation, and those opened up as early as possible to as many people as possible. Name this phrase.

Bonus 14: Name either of the two modules bundled with Perl that open a process for both reading and writing, letting you both provide it with input and see the output it displays.

Bonus 15: I’ll give you six animals and six O’Reilly Perl titles. You match them up. The animals are the camel, emu, llama, leopard, sheep, and wolf. The books are Advanced Perl Programming, Learning Perl, Learning Perl/Tk, Mastering Algorithms with Perl, Perl Cookbook, and Programming Perl.

Bonus 16: I’ll give you four operators, and you tell me about their precedence: whether they associate to the right or the left.

  1. and

  2. not

  3. *

  4. **

Bonus 17: I asked Jeeves the following question: “What are the arguments to split?” I’ll give you five topics; you tell me whether that topic appeared in the resulting list of answers. Just say yes or no.

  1. Perl’s split function

  2. The Microsoft breakup

  3. Divorce

  4. Banana splits

  5. Stock splits

Bonus 18: What is the three-letter abbreviation for the encryption used on DVDs?

What does CSS stand for?

Bonus 19: When you tie a scalar to a class, there are three functions the class must provide. The functions are all in uppercase. What are they?

Bonus 20: Since you’re on a cruise, we’ll play Guess That Maritime Disaster. What ship sank three years after the Titanic, resulting in the loss of 1,198 lives from a German torpedo?

Bonus 21: This Perl extension was begun by astronomer Karl Glazebrook, who wanted the speed of mathematical packages like MATLAB and IDL with the convenience of Perl. What is this package, optimized for large multidimensional arrays of data?

Bonus 22: I’ll ask you three questions about an interactive online discussion group named “pound perl.” What text-based collection of channels is “pound perl” part of?

What network of IRC channels is the heavily-populated #perl part of?

Finally, spell the name of the chatbot, written in Perl of course, that answers newbie questions without human intervention.

Bonus 23: Suppose $x is a reference to an array. If you say $y = $x, you copy the reference, but not the underlying data. Copying the underlying data is called a deep copy. One module, bundled with Perl, contains a function called Deepcopy that helps you make deep copies. But the module is named after another useful function, one which stringifies data structures suitable for printing or saving to disk. Name that module.

Bonus 24: I’ll name three symbols; you give me the ISO 8859-1 entity name. For instance, if I said “less-than sign”, you’d say <. If I said “non-breaking space,” you’d say  .

  1. Copyright symbol

  2. An O with two dots over it

  3. An E with a backtick over it

Bonus 25: Take a hash, any hash. Call it %X. It has some number of key/value pairs. Now create a new hash, %Y, in which the key/value pairs of %X become value/key pairs in %Y. That is, the keys of %X become the values of %Y, and the values of %Y become the keys of %X. Which of the following statements is true?

  1. %Y is guaranteed to have the same number of key/value pairs as %X.

  2. %Y is guaranteed to have no more key/value pairs than %X.

  3. %X is guaranteed to have no more key/value pairs than %Y.

  4. None of the above.

Bonus 26: You can use the MIME::Lite module to send email with MIME attachments. I’ll give you three types of attachments you might send; you give me the MIME media type and subtype. For instance, if I said “An HTML document,” you’d reply “text” and “html.” “Text” is the media type, and “html” is the media subtype.

  1. Plain text

  2. A normal mail message, with headers

  3. Generic binary data

Bonus 27: What system generates XS code from C and C++ programs, and in fact performs equivalent feats for Java, Tcl, and Python?

Bonus 28: Name that module. This module, which is bundled with Perl, is a compiler backend that turns compiled Perl programs back into source code. It’s sometimes helpful for seeing how Perl has parsed your program.

Bonus 29: True or false: with the latest release of Perl, you can now overload dereferencing, so that you can specify new behavior for what happens when you access, say, the scalar value behind a scalar reference, or a hash value behind a hash reference.

Bonus 30: When you create a Perl/Tk program, you choose a geometry manager to lay out your widgets. What are the three geometry managers?

Bonus 31: Slashdot runs on Perl code. Answer these three questions about the software underlying Slashdot.

  1. What is the software underlying Slashdot called?

  2. What web server does Slashdot use?

  3. What database does Slashdot use?

Bonus 32: A bonus on cruises to other cold places.

Cruises to Antarctica typically originate on which two continents?

What is the name of the largest Antarctic base?

Bonus 33: What pod directive is used to explicitly indent text, as in an itemized list?

Bonus 34: The act of translating hostnames to Internet addresses is called name resolution, and the infrastructure supporting it is called DNS. Microsoft might want to call that the Digital Nervous System, but most of us know that it really stands for what?

Bonus 35: Rhyme that keyword: I’ll give you four English words, you give me a Perl built-in that rhymes with it.

  1. Peach

  2. Sneeze

  3. Slipped

  4. Power

Bonus 36: If the actual temperature outside is forty degrees Fahrenheit, and the wind speed is forty miles per hour, what is the wind chill? That is, how cold does it feel? Your answer must be within three degrees Fahrenheit.

Bonus 37: This module provides a function called ReadMode that lets the users of your program type characters without them echoing on the screen.

Bonus 38: What is a thousand terabytes called?

Bonus 39: This is Apple Computer’s version of a new standard for connecting multimedia devices to your personal computer. It uses a plug-in serial connector and a data transfer rate in the hundreds of megabits, and lets you chain devices together without terminators.

Bonus 40: The person writing these questions is sick of hearing about ASPs. There are two completely different common expansions of this acronym, and he hates them both. What are the two expansions?

Bonus 41: A BEGIN block is executed during compilation; an END block is executed when the interpreter exits. Perl now has two new kinds of blocks. One is executed at the end of compilation, and the other is executed at the beginning of execution. What are the names of these two blocks?

Bonus 42: I’m looking for two mathematical functions that Perl provides. If you apply both functions to the same number and sum the squares of the results, the answer will always be 1. What are the two functions?

Bonus 43: The $] variable contains the version number of your Perl, which is probably 5, plus the patchlevel divided by some number. What is that number?

Bonus 44: What does this print?

$x = "1d4"; substr($x, 1, 1)++; print $x-1;

Bonus 45: What array holds the command-line arguments for a Perl program?

Bonus 46: What regular expression metacharacter represents a word boundary?

Bonus 47: This company patented its affiliate program, which enables web sites to exchange customers for a small commission. They patented one-click ordering, and took their rival Barnes & Noble to court for infringement. What is this online bookseller founded by Jeff Bezos?

Bonus 48: A device is 80% likely to last ten years and 20% likely to last five years. What is the mean time between failures?

Bonus 49: With this flag, Perl pretends that every block in your program has a use warnings all declaration. Name this single letter.

Bonus 50: What regular expression extension keeps Perl from backtracking?

Bonus 51: This function turns a list of values into a string, but it’s not join. You can specify whether particular values should be interpreted as big-endian numbers, or hexademical numbers, or uuencoded strings, or regular characters. What is this four-letter function?

Toss-up Answers

T1. POTATOs.

T2. CENSORSHIP

T3. MAIN

T4. GEEK CRUISES

T5. $^T or $BASETIME

T6. PNG (can be pronounced “ping”)

T7. PERCENT

T8. Donald KNUTH

T9. @ISA

T10. SEARCH.CPAN.ORG

T11. DVD

T12. META

T13. LOWERCASE T

T14. SAMBA

T15. EXEC

T16. UNICODE

T17. NET::

T18. QUEEN ELIZABETH II (also accept ELIZABETH Alexandra Mary WINDSOR) (Tidbit: The web site for the royal family uses Linux.)

T19. PROCESS ID or RETURN VALUE of fork

T20. The ILOVEYOU virus

T21. CONFIG

T22. BEOWULF

T23. UNLINK

T24. CRYPTONOMICON

T25. LIB

T26. DTD or DOCUMENT TYPE DEFINITION

T27. STAT

T28. SDBM

T29. $= or $FORMAT_LINES_PER_PAGE

T30. IPV6 or IPNG

T31. PERLLOCAL.pod (You can type perldoc perllocal to see what modules have been installed on your system.)

T32. TIED

T33. JANUARY. (Yes, the winter solstice is in December, and that’s the longest day. But the longest day has neither the latest sunrise nor the earliest sunset.)

T34. TAINTed

T35. LVALUE

T36. POE

T37. 63

T38. SEEK

T39. GIBBOUS

T40. WANTARRAY

T41. GREP

Bonus Answers

B1. DBD::ORACLE

B2. DOG

B3. TWENTY

B4. UNTIL, VALUES, TIMES, SEMOP, TRUNCATE, CHROOT

B5. MERCED

B6. 84 (Full credit for an answer between 74 and 94.)

B7. YES, YES, NO, NO

B8. -1

B9. APACHE::THROTTLE

B10. 0X (“ZERO” and “EX”)

B11. 7, 5, 3C

B12. PUBLIC KEY cryptography

B13. The CATHEDRAL and the BAZAAR

B14. IPC::OPEN2 or IPC::OPEN3

B15. CAMEL => PROGRAMMING PERL, EMU => Learning PERL/TK, LLAMA => LEARNING PERL, LEOPARD => ADVANCED PERL Programming, SHEEP => The Perl COOKBOOK, WOLF => Mastering ALGORITHMS with Perl

B16. LEFT, RIGHT, LEFT, RIGHT

B17. YES, NO, YES, NO, YES

B18. CSS (DeCSS is the program that decrypts CSS), CONTENT SCRAMBLING SYSTEM

B19. TIESCALAR, FETCH, STORE

B20. LUSITANIA

B21. PDL

B22. IRC or INTERNET RELAY CHAT, EFNET, P U R L

B23. DATA::DUMPER

B24. ©, ö, è

B25. 2

B26. TEXT/PLAIN, MESSAGE/RFC822, APPLICATION/OCTET-stream

B27. SWIG

B28. B::DEPARSE

B29. TRUE

B30. PACKer, GRIDder, PLACEr.

B31. SLASHcode, APACHE, MySQL

B32. AUSTRALIA and SOUTH AMERICA, MCMURDO

B33. OVER

B34. DOMAIN NAME SYSTEM

B35. EACH, KEYS, CRYPT, OUR

B36. TEN (accept between SEVEN and THIRTEEN)

B37. TERM::READKEY

B38. PETABYTE

B39. FIREWIRE

B40. APPLICATION SERVICE PROVIDER and ACTIVE SERVER PAGEs

B41. CHECK and INIT

B42. SINe and COSine

B43. 1000

B44. 9999

B45. ARGV

B46. B (no need to specify case)

B47. AMAZON

B48. NINE years

B49. -W (if the player doesn’t say “Capital W,” say “be more specific”)

B50. ?>

B51. PACK

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset