I found this while monkeying around on CPAN. I havent seen this on PM yet. Anyways this can be found at perl.purity.test

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 or
..!hplabs!hpcc01!okamoto.

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 (c) 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
-----

Replies are listed 'Best First'.
Re: Perl Purity Test
by diotalevi (Canon) on Mar 30, 2006 at 21:09 UTC

    It looks like it was targetted at perl4 from the way it mentions linking in user subroutines. It's also missing the right terms when it says things "associative array" and "list of lists."

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Re: Perl Purity Test (For Update)
by wazoox (Prior) on Mar 31, 2006 at 10:26 UTC
    A newer version (december 1996) is available on The Perl Journal website, with 100 more questions and the program to play the quizz.
Re: The "New" Perl Purity Test
by zer (Deacon) on Mar 30, 2006 at 21:22 UTC
    ya judging by the last modified date (DEC 92) there is definately a few things that have lost currency. Still a lot can stay.

    How about this: We update this on this node and ill send it off to the author for updating.
    We can get rid of what doesnt work and add some new stuff to it.

Re: Perl Purity Test (For Update)
by nferraz (Monk) on Mar 31, 2006 at 12:27 UTC

    I wrote this script to play the above purity test:

    #!/usr/bin/perl -w use strict; use Term::ReadKey; my %answer; while(<DATA>) { if (/^\.\.\./) { chomp; print "$_ (y/n)"; my $ans = ''; ReadMode('cbreak'); $ans = ReadKey(0) while ($ans ne 'y' and $ans ne 'n'); print "$ans\n"; ReadMode('normal'); $answer{$ans}++; $answer{t}++; } else { print; } } my $py = $answer{y} / $answer{t} * 100; my $pn = $answer{n} / $answer{t} * 100; print <<"EOF"; Results: You answered: $answer{y} 'yes' ($py %) $answer{n} 'no' ($pn %) EOF __DATA__

    (Copy and paste the purity test after __DATA__)

Re: Perl Purity Test (For Update)
by jonadab (Parson) on Apr 01, 2006 at 03:05 UTC

    Some things not covered...

    • ... used a module from the Acme:: namespace?
    • ... used a module from the Acme:: namespace in a production environment?
    • ... used more than one module from the Acme namespace, in the same script?
    • ... written a module in the Acme namespace?
    • ... used a lexical closure?
    • ... used an array or hash of lexical closures?
    • ... used lexical closures that return other lexical closures?
    • ... written an article published in a magazine devoted to Perl?
    • ... written a regular column for a magazine devoted to Perl?
    • ... written an article published on the O'Reilly Perl site?
    • ... written a regular column for the O'Reilly Perl site?
    • ... spoken face-to-face with Larry's wife?
    • ... subscribed to perl6-language?
    • ... subscribed to perl6-internals?
    • ... subscribed to perl6-compiler?
    • ... regularly summarized any of the perl6 mailing lists?
    • ... written an RFC for Perl6?
    • ... used a version of Perl prior to Perl4?
    • ... used a custom-compiled version of Perl5 (e.g., with the defined-or operator)?
    • ... become frustrated because a certain CPAN module was not installed on a production system, and in your view should have been?
    • ... become frustrated because a certain CPAN module was too out-of-date on a production system, and needed to be ugraded?
    • ... written your own Bundle:: module to assist with installing all of your requirements from the CPAN on multiple computers?
    • ... created your own CPAN mirror to assist with keeping all of your systems up to date?
    • ... run a public CPAN mirror?
    • ... used a text editor with a Perl interpreter embedded in it, similar to the lisp interpreter in Emacs?
    • ... written an application with a Perl interpreter embedded in it?
    • ... created a compiler (for any language) that targets the Parrot vm?
    • ... created, or committed more than 500 lines of code to, a Perl6 compiler?
    • ... gotten anxious for an upcoming Perl6 feature, then found and used a module from the CPAN that implements it in Perl5?
    • ... implemented a major feature of Perl6 in a module for Perl5?
    • ... used Inline?
    • ... used Inline::Pugs?
    • ... dreamed about Perl?
    • ... dreamed in Perl?
    • ... fantasized about Perl during the day?
    • ... kept more than one version of perl installed on the same computer at the same time (e.g., 5.6 and 5.8 in different directories)?
    • ... installed modules from the CPAN in a private directory when you don't have admin privileges to install them for the whole system?
    • ... installed perl in a private directory, when you don't have admin privileges to install it for the whole system?
    • ... taken a piece of Perl obfuscation that someone else wrote and golfed it down by more than 10%?
    • ... chained more than five list transformations (e.g., map, grep, sort) end-to-end, for non-obfuscatory purposes?
    • ... used map to transform a list of anonymous subroutines?
    • ... nested map more than two levels deep?
    • ... deliberately used map in void context?
    • ... deliberately used grep in void context?
    • ... deliberately used sort in void context?
    • ... deliberately used map, grep, or sort in void context, for non-obfuscatory purposes?
    • ... written a module for the sole purpose of creating an object-oriented interface for an extant module that wasn't object-oriented?
    • ... written a module for the sole purpose of creating a non-object-oriented interface for an extant module that was object-oriented?
    • ... become the official maintainer of a CPAN module that you did not originally create?
    • ... looked in a CPAN author's PAUSE upload folder for a new version of a module that had not yet reached any of the other CPAN systems?
    • ... and found it, and had it installed before the rest of CPAN picked it up?
    • ... corrected Larry, Randal, or Tom on some Perl-related point, and been right?
    • ... written a regular expression more than ten lines long, excluding comments?
    • ... stored compiled regular expressions as part of a larger data structure?
    • ... written a custom internet server (e.g., webserver, mailserver, proxy, ...) in Perl, and used it in a production environment?
    • ... implemented recursion by having a script exec itself?
    • ... written a Perl program that makes extensive use of fork?
    • ... written a Perl program that makes extensive use of threads?
    • ... used POE?
    • ... written a device driver in Perl?
    • ... broken Universal::ISA?
    • ... understood how the output of Acme::Eyedrops works?
    • ... gotten a job using a resume that contains the word "Perl" (or "perl") more than five times?
    • ... introduced someone else to Perl who was not previously familiar with it?
    • ... taught a class in Perl?

    Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. Why, I've got so much sanity it's driving me crazy.
Re: Perl Purity Test (For Update)
by robharper (Pilgrim) on Mar 31, 2006 at 09:12 UTC
    I don't remember the last time I heard anyone referring to "The Perl Book". Doesn't everyone call it "The Camel Book"?
Re: Perl Purity Test (For Update)
by Juerd (Abbot) on Apr 01, 2006 at 00:23 UTC
    I realize it's an old list from 1992, but I'll answer as if it were written today. Jargon has changed, making the old list a bit weird, and perhaps even damaging the minds of those who try to learn modern Perl, who aren't interested in history.

    ... used undocumented features?

    That's the same as: ... encountered a bug?

    ... used reserved keywords as variable names?

    Irrelevant. We have sigils so that reserved words and variable names have nothing to do with eachother. The question might make a little more sense if it said "file handle names", but smart coders who write modern Perl have sigils for those too.

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

    Do golfed oneliners count as scripts?

    ... created variables at runtime?

    That happens automatically more often than most people realize.

    ... used lists of lists?

    No, Perl tends to flatten that.

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

    Don't tell anyone, but we call them hashes now.

    ... created a loop label at runtime?

    Hmm, no. Please teach me how. (eval?)

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

    Hahaha. We have many, many more than 9 now.

    ... used grep on non-arrays?

    Yeah, I tend to use it on lists.

    ... used up to five nested evals? ... used more than five nested evals?

    Sure, but eval was masked as use, require, and do :)

    ... abused dynamic scoping by fudging @ARGV?

    That is not abuse.

    Heavy Wizardry ... used autoloading functions?

    (Funny to see that this was ever considered as heavy wizardry :))

    the Perl book?

    Which one?

    Perl is Copyright (c) 1989, 1990, 1991 by Larry Wall

    And 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 :)

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Re: Perl Purity Test (For Update)
by CountZero (Bishop) on Mar 31, 2006 at 20:19 UTC
    I find "Purity tests" only interesting if you can have access to the results of others, so that reminds me to set one up on a server I control and innocently direct my co-workers to it. ;-)

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law