Softpanorama 91a (vol.9, No.2) Computer Humor

# Softpanorama 92a (vol.9, No.3),

# Computer Humor

# The Perl Purity Test

Version 1.01, October 30, 1992

Written by Jeff Okamoto

With Help from Tom Christiansen

This is similar to other Purity Tests, of which perhaps the most famous is the Unisex, Omnisexual Purity Test that can be found in soc.singles. Additions are welcome. Please send them to okamoto@ranma.corp.hp.com

All questions begin with "Have you ever..." Answer each question with a "yes" or "no". Keep track of how many "yes" answers you give. When finished, subtract that number from the total number of questions, then divide by the number of questions to get a percentage. This percentage is your perl purity. There are 125 questions in this version.

Usage

... rewritten a Unix command in perl?

... rewritten a DOS command in perl?

... emulated a kernel feature inside a program in perl?

... written a compressor/decompressor using pack?

... written scripts that generate other scripts?

... used undocumented features?

Variables

... used reserved keywords as variable names?

... used $x, @x, and %x in a script?

... used $x, @x, %x, and *x in a script?

... not gotten confused when you used $x, @x, %x, and *x all in that script?

... written a script with no alphabetic characters in it?

... no alphanumeric characters in it?

... used variables with control-characters other than ones already defined?

... created variables at runtime?

Lists

... used lists of lists?

Associative Arrays

... used associative array operators on the main symbol table?

Functions

... created functions at runtime?

... written a function that returns different types? (e.g., scalar, list, etc.)

... called a subroutine with the & operator and no arguments so that the

child function inherited what remains of the caller’s argument stack, @_?

... changed function definitions on the fly?

... used wantarray?

... returned a "0 but true" scalar?

Loop Controls

... used do BLOCK inside an EXPR?

... used loop controls (e.g., last, next, etc.) from inside a signal handler?

... created a loop label at runtime?

Operators

... used the scalar ".." operator?

... used it with things other than line numbers, array indices, or regexps?

... used syscall?

Searching and Replacing

... used the /e switch?

... used the /ee switch?

... used a /eee or higher number of e’s in a switch?

Handles

... used arrays of file handles?

... used indirect file handles?

... used doubly indirect file handles?

... used a directory handle as a file handle?

... and gotten away with it?

... used a file handle as a directory handle?

... and gotten away with it?

Regexps

... used all nine sets of parentheses in a regexp?

... used more than nine sets of parentheses in a regexp?

... used nested parentheses in a regexp?

... wished for an equivalent to LISP’s meta-close character "]", which closes all currently open parentheses?

Grep

... used grep on non-arrays?

... nested grep within another grep (for a total of two greps)?

... nested up to five greps within one statement?

... nested more thann five greps within one statement?

Evals

... written self-modifying evals?

... used eval to test for features your brain-damaged version of Unix doesn’t have?

... used eval/die to emulate setjmp/longjmp?

... nested an eval inside another eval (for a total of two nested evals)?

... used up to five nested evals?

... used more than five nested evals?

References

... used references?

... used lists of references?

... used associative arrays of references?

... lost your referents and didn’t care?

I/O

... used stream sockets?

... used datagram sockets?

... used RPC?

Debugging

... used the -D flag?

... used the -D1024 flag?

... figured out what all that debugging info meant?

... used the perl debugger?

... modified the perl debugger?

Packages

... written your own package?

... used packages to emulate structures?

... referenced a package’s symbol table via %_packagename?

User Subroutines

... gotten frustrated with the documentation of how to link in user subroutines?

... written a subroutine to be linked in with uperl.o so that your routine can be called from a perl script?

... replaced your version of perl with a version that has your subroutine(s)?

Scoping

... abused dynamic scoping by fudging @ARGV?

... abused dynamic scoping and changed the names of functions?

h2ph

... debugged the result of h2ph?

... hacked on h2ph?

c2ph

... debugged the result of c2ph?

... hacked on c2ph?

... ported gcc so you can use c2ph?

Heavy Wizardry

... used autoloading functions?

The Source of Taintedness

... used taintperl?

... tried to subvert the TAINT checks?

... read the source to see what happens if you successfully subvert the TAINT checks?

... changed the source to change what happens if you successfully subvert the TAINT checks?

... tried to read the source?

... found the comment "/* Heavy wizardry */" other than by deliberately searching for it now that you know it exists?

The Father, the Son, and the Holy Ghost

... sent mail to Larry asking for help?

... sent mail to Larry reporting a bug in perl?

... sent mail to Larry requesting a feature?

... gotten a reply from Larry (as opposed to his autoreplier)?

... gotten more than ten autoreplies from Larry?

... sent mail to Randal asking for help?

... sent mail to Randal reporting a bug in perl?

... sent mail to Randal with an idea for a JAPH script?

... sent mail to Tom asking for help?

... sent mail to Tom reporting a bug in perl?

... sent mail to Tom pointing out an error in his slides?

... had a requested feature be included in a subsequent set of patches?

... had up to five requested features included?

... had more than five requested features included?

Trivia

... written a "Just another Perl hacker" script?

... written five or less JAPH scripts?

... written more than five JAPH scripts?

... written any perl poems?

... run these perl poems?

Other Fun Stuff

... used unquoted strings?

... used them unintentionally?

... seeked on __DATA__ to reread your script?

... tried to use a bi-directional pipe?

... realized why this is a waste of time?

... used co-routines in a perl script?

... written a script that used command-line switches?

... used up to five command-line switches?

... more than five command-line switches?

... written a script with its own man page embedded in it?

... counted how many perl functions are overloaded?

The Torah and Talmud of Perl

... referred to the Perl book?

... bought the Perl book?

... bought multiple copies because you wore out the previous copies?

... owned more than one edition of the Perl book?

... owned more than one copy of every edition of the Perl book?

... wondered why Larry and Randall chose a camel for the cover?

... found out why Larry and Randall chose a camel?

... read comp.lang.perl?

... posted to comp.lang.perl?

... applied a kill file to comp.lang.perl?

Perl is Copyright © 1989, 1990, 1991 by Larry Wall The Perl Book, "Programming Perl", is written by Larry Wall and Randal L. Schwartz, published by O’Reilly and Associates, Inc. ISBN 0-937175-64-1