| CARVIEW |
Perl Paraphernalia
Mark Jason Dominus

History of changes to my pages, including this one.
Legend
Added in the last four weeks.
Updated in the last four weeks.
Don't hold your breath.
| Higher-Order Perl |
Complete List of Perl Paraphernalia
- Why I am boycotting Amazon -- $581.96 so far.
- List of upcoming public appearances
- Search Perl Paraphernalia
- Classes and Talks: General Information
- Lightning Talks / Communications éclair
- Paid Classes
- Advanced Topics in Perl
- CGI Programming with Perl
- Hands-On Introduction to Perl
- "How do I delete a line from a file?"
- Intermediate Topics in Perl
- Making Programs Faster
- Object-Oriented Programming In Perl
- Perl Program Repair Shop and Red Flags
- Perl Regular Expression Mastery
- Programing with Iterators and Generators
- Stolen Secrets of the Wizards of the Ivory Tower
- Tricks of the Wizards
- Web Application Security
- Free Talks
- Conference Presentation Judo
- "Design Patterns" Aren't
- Dirty Secrets of the Perl Regex Engine
- File Locking Tricks and Traps
- Hook::LexWrap
- The Identity Function
- Internals of Familiar Unix Commands
- Internals of the ext2 Filesystem
- Perl Contains the Lambda Calculus
- The Perl Hardware Store
- The Perl Hardware Store (DC.pm Version)
- The Perl Hardware Store (NYLUG Version)
- Quantitative Analysis of Memoization
- Return To The Perl Hardware Store
- Rx, the Perl Regular Expression Debugger
- Strong Typing and Perl
- System Programming in Perl
- Tie::File
- Using tie to Escape Feature Creep
- This is the program that I used to make the slides.
- Mailing Lists
- Perl Journal Articles
- Bricolage
- Just the FAQs
- Reviews
- Miscellaneous
- Other Published Articles:
- qrpff Explained (Wired June 2001)
- IEEE Software
- What's That Mean? (PerlMonth #1 - May 1999)
- My Life With Spam Linux Planet Web Site
- Articles from www.perl.com
- A Short Guide to DBI (October 1999)
- Sins of Perl Revisited (November 1999)
- My Life With Spam II (February 2000)
- My Life With Spam III (March 2000)
- POD is Not Literate Programming (March 2000)
- Program Repair Shop and Red Flags I (May 2000)
- Perl Meets COBOL (May 2000)
- Program Repair Shop and Red Flags II (June 2000)
- Reports From YAPC 19100 (July 2000, with ten others)
- Report on the Perl 6 Announcement (July 2000)
- Guide to the Perl 6 Mailing Lists (September 2000)
- Critique of the Perl 6 RFC Process (October 2000)
- Program Repair Shop and Red Flags III (November 2000)
- Red Flags Return: Reader Responses (November 2000)
- Why I Hate Advocacy (December 2000)
- Perl Program Repair Shop and Red Flags at the Open Source Conferences (May 2001)
- Why Not Translate Perl to C? (June 2001)
- Usenet Articles
- Why Questions go Unanswered
- What is `Scalar Context'?
- Why it's stupid to `use a variable as a variable name' Part 1 2 3
- Joining two tied hash classes into one.
- Perl Modules
-
Tie::File
-
Text::Template
- Memoize
- Interpolation
- Stat::lsMode
- Devel::Trace
- Algorithm::Diff (and diff.pl)
- Locked
- Tie::HashHistory
- Apache::AddrMunge
- The Very Very Short Tutorial about Modules
- Async
- ArrayHashMonster
- FakeHash and FakeHash::DrawHash
- Rx: A Regex Debugger for Perl
- EZDBI is a quick and simple interface to SQL databases
-
- Perl Programs
- units
-
Adventure
- Obfuscated Perl Contest Entry
- Perl Stupidity
- Identity is incredibly funny. You must look at this module.
- Addition is possibly the stupidest Perl program ever written.
- Roman is a new contender for stupidest Perl module ever written.
- allsubs is a stupid module that might actually be useful.
- April Fools' Day (Explanations
and analysis to follow eventually.)
- Thursday, April 1, 1999
- Saturday, April 1, 2000
- Through some grievous and inexplicable oversight, no port of Perl to the TRS-80 Model I microcomputer yet exists. Until that happens, you can simulate the TRS-80 environment with this new module.
- Sunday, April 1, 2001
- Monday, April 1, 2002
- Perl's time and calendar functions always need improvement. This is an obvious and useful extension of the localtime function
- When Hashes Go Wrong
- Perl Oddity: A program that writes parser programs in Perl
- Read a description of the 1967 edition of Perl!
- Perl regex matching is NP-complete.
- A Perl program that prints its own source code
- Perl Paraphernalia links
- Minutes from the next-to-last meeting of the Perl Institute (2 December 1997)
- Minutes from the last meeting of the Perl Institute (3 March 1999)
- What does that
logo
mean?
Articles for The Perl Journal
This area contains text, source code, and notes about my column in The Perl Journal. As new articles appear, I'll add them here.
Autumn 1997: Infinite Lists
Winter 1997: B-Trees
Spring 1998: How Regexes Work
How do Perl's regexes work on the inside? Suppose you were going to write a language like Perl, which has regexes, in a language like C, which doesn't? How might you do that?
Regex article notes and errata page
- This article explains how it works.
- A sidebar explains the academic terminology that I didn't use in the article.
- This module, Regex implements the scheme described in the article.
- This program, grep.pl implements a version of Unix grep in Perl without using Perl's built-in regexes.
- This program, demo.pl demonstrates that for some tasks, the Regex library is a whole lot faster than Perl's builtin regexes.
Summer 1998: Ray Tracing
Ray tracing is one of the most flexible and versatile methods of rendering three-dimensional computer images. In this article, I show you a simple ray tracing program written in Perl and explain how it works.
- PostScript version of article.
- Ray-tracing software
- Tar file with ray-tracing software and sample input files
- Do-it-yourselfer?
- LaTeX source code for the articles
- DVI file
- MetaPost source code for the figures
- PostScript figure files: 1 2 4 7
Summer 1998: Just the FAQs: Understand References Today
One of the most important new features in Perl 5 was the capability to manage complicated data structures like multidimensional arrays and nested hashes. To enable these, Perl 5 introduced a feature called `references', and using references is the key to managing complicated, structured data in Perl. Unfortunately, there's a lot of funny syntax to learn, and the manual is not as clear in this area as it usually is. The manual is quite complete, and a lot of people find that a problem, because it can be hard to tell what is important and what isn't.
Fortunately, you only need to know 10% of what's in the manual to get 90% of the benefit. This article will show you that 10%.
Autumn 1998: Just the FAQs: Suffering From Buffering?
The deadline for written materials for The Perl Conference got in my way, so I wasn't able to do two articles again this issue. I put my regular Bricolage column on hold and wrote another article for novices. It's about how stadard I/O buffering works and shows typical traps and hazards and how to avoid and remedy them. I think even experienced programmers will learn something from it.
If you're sad that you missed my regular Bricolage column because it was on vacation, then seeing the notes for my conference talk might make you feel better.
Winter 1998: Just the FAQs: Coping with Scoping?
This article discusses issues of variable scope and duration in Perl, including packages, namespaces, and the difference between my and local. The Big Secret: Perl has two separate and totally unrelated sets of variables.
Winter 1998: Bricolage: Data Compression
This article discusses how data compression works. It comes with a module, Huffman, which implements a simple data compression scheme in Perl.
Spring 1999: Bricolage: Memoization
Caching is a straightforward way to speed up certain slow functions: You remember the return values by storing them in a cache, and if you are going to compute the same value again later, just get the result from the cache instead of recomputing it. It turns out it's not hard to build a facility that replaces any function with a caching version automatically; this is called memoization. This article explains how such a module works, and shows a number of interesting applications and contexts for memoization and caching.
- Memoization article main page
- Article in HTML format
- MiniMemoize, a simple memoizing module that is explained in the article
- Main page for heavy-duty Memoize module from CPAN
Summer 1999: Seven Useful Uses of local
In my article Coping With
Scoping I offered the advice ``Always use my;
never use local.'' The most common use for both is to
provide your subroutines with private variables, and for this
application you should always use my, and never
local. But many readers (and the tech editors) noted that
local isn't entirely useless; there are cases in which
my doesn't work, or doesn't do what you want. So I
promised a followup article on useful uses for
local. That is what this article is about.
Autumn 1999: Just the FAQs: Precedence Problems
I wrote a tutorial article about what precedence is and how it works in Perl.
I also wrote a review of Perl 5 For Dummies, by Paul Hoffman, published by IDG books. The review was quite a surprise to me; it didn't turn out the way I expected at all.
Other Articles
For IEEE Software
I wrote an article for IEEE Software magazine; it's their first-ever article about Perl. It appears in Vol. 15, #1 (the January / February 1998 issue) pages 69-74.
It's partly an introduction to the language for people who have never seen it before, and partly a big boast about how great Perl is. I'm not sure I believe that Perl is as great as I made it out to be, but I do think it's pretty good.
Read the plain text of my last draft, or get a PDF copy of the published version from The Computer Society (Computer Society members only).
Modules
Text::Template
Current version: 1.41. Last update: 2001-09-04.
- Read all about it here
- Read documentation
- Download most recent version including Makefile and test suite
- View source code
Memoize
Current version: 0.61. Last update: 2000-10-24.
The Memoize module will make your functions faster by remembering their old values and reusing them instead of recomputing the same thing twice. It is very easy to use. Very very easy. Step 1: Say memoize('some_function'). Step 2: There is no step 2. I told you it was easy.
- Main Memoize page.
- Read documentation
- Download most recent version
- View source code
- View source code for Memoize::Expire, an expiration manager plug-in for Memoize
- Expiration manager documentation
Interpolation: Why Identity wasn't as funny as I thought.
Current version: 0.53. Last update: 1998-04-09.
This module lets you define arbitrary string interpolation semantics, which means that you can control the way variables and other expressions interpolate into your strings. Perl already provides \L...\E and \U...\E to say that a string should be put into lowercase or uppercase when it's interpolated; Interpolation extends this notion. The notation is compact and readable, and you can have as many interpolators as you want.
- About Interpolation
- Complete documentation
- Peruse the source code
- Dowload the complete package. (Include makefile, test scripts, etc.)
- See a list of clever uses for Interpolation contributed by users.
- Do you have a clever use for Interpolation? Please share it with me here! (Or just send me mail about it.)
Stat::lsMode
Current version: 0.50. Last update: 1998-04-20.
Stat::lsMode is a module for displaying file permission modes in the style of the UNIX ls -l command. For example, a plain file that is world-readable and writable only by its owner is represented by the string -rw-r--r--.
- Stat::lsMode main page
- Read documentation
- Download most recent version including Makefile and test suite
- View source code
Locked
Current version: 0.1. Last update: 1999-02-03.
Locked is a module for providing scalar variables that can be locked and unlocked. Unlocked scalars behave normally. Locked scalars abort the program if you try to assign to them. Variables can be locked and unlocked; you can also test them to see if they are locked or not.
It's also a fine demonstration of the power of tie
I just wrote this, so there's little documentation and no test suite yet.

Perl Stupidity
Identity: A Very Funny Module
This is one of the funniest pieces of software I have ever written. It is an absolute riot. And it is even possibly useful. It is called Identity, but I am looking for a better name. If you want to know why it's useful, it will help to read the explanation first.
Addition is possibly the stupidest Perl program ever written.
I don't really believe that it is the stupidest. In fact, you should watch this space for the sudden appearance of other stupid programs. But it sure is mighty stupid though.
- Read the source code first, even though...
- Most of the real stupidity is actually in this idiotic module.
Roman is a new contender for stupidest Perl module ever written.
This one may give Addition a run for its money, if only because it takes so darn long to load.
- Look at the demo program first.
- This demo also uses Interpolation to achieve a more useful (ha ha) functionality.
- Most of the real stupidity is actually in this idiotic module.
allsubs is a stupid module that might actually be useful.
Following a suggestion of Alex Davies, this module tries to automatically locate and declare all your subroutines at compile-time, so that you don't have to do it yourself.
Read the notes and then scrutinize the code.
Other Paraphernalia and Miscellanea
Perl Regex Matching is NP-complete
Sometimes Perl can take a very long time to evaluate a regular expression match. Is this a problem with Perl's implementation of regexes? The answer is no; this paper shows that regex matching in Perl is NP-complete. This means that if you could come up with an efficient way to evaluate regex matches in Perl, you would become very famous because your method would also be an efficient way to solve many other well-known and difficult problems.
Usenet Articles
Why Questions go Unanswered
Someone on comp.lang.perl.misc wanted to know why nobody was answering his questions. In answer, I wrote an article about how to ask a question so that it'll get an answer.
What is `Scalar Context'?
Why doesn't print reverse $x work? And what is `Scalar Context'? And what is the scalar builtin function for? This short article explains contexts and the scalar function.
Why it's stupid to `use a variable as a variable name'
People show up in comp.lang.perl.misc all the time asking how to use the contents of a variable as the name of another variable. For example, they have $foo = 'snonk', and then they want to operate on the value of $snonk. This anecdote suggests that is probably a bad idea, and explains what you should probably be doing instead.
This follow-on article goes into more specifics about the sorts of things that can go wrong, and what to do instead.
Is there no end to this topic? No, apparently not.
When Hashes Go Wrong
This program demonstrates what happens When Hashes Go Wrong. It accepts one command-line argument, N, which defaults to 10,000. It then constructs N strings and uses them as keys for the hash. The strings are constructed so that their hash values are all the same, so they all go into one hash bucket. This turns the hash search into a linear search---very slow.
Perl has one small win here. Normally, Perl increases the number of buckets as the number of items in the hash increases. If it did that here, it would be wasting time and space, since this program only uses one bucket. But fortunately for Perl, this program doesn't trigger the condition that makes Perl expand the hash: Perl only does that when a key is inserted into a previously empty bucket.
A Program to Write YACClike Parsers in Perl
This program, py, implements LALR(1) parsers in Perl. These are the sorts of parsers produced by YACC and Bison. But the program is a complete oddity. Find out why.
Perl, 1967 edition
It occurred to me today that there was a language I'd heard about before that sounded a lot like Perl. I looked it up, and sure enough, it sounded just like someone in 1967 describing Perl. You can read the description of Perl '67 and try to guess what language is really being described.
Over the next few weeks I hope to research this language and learn whether it really does resemble Perl as much as it seems to. If so, it could be a valuable example lesson that could teach us a lot about how to develop Perl and what sorts of mistakes to avoid.
Perl Paraphernalia Links
If you hated this page, you'll probably also dislike:
- Uri's Perl Book Page
- Roderick Schertler
- Perlguts Illustrated
- Steven McDougall
- Kaoru Maeda
- Jenda Krynicky
- Stephen B. Jenkins
- Joseph Hall
- Cassidy Curtis
- Damian Conway
- Sean Burke
- Graham Barr
- Abigail
I'd be glad to get other people's recommendations of other pages of Perl Paraphernalia.
Search Perl Paraphernalia
Software entities are more complex for their size than perhaps any other human construct because no two parts are alike. If they are, we make the two similar parts into a subroutine -- open or closed. In this respect, software systems differ profoundly from computers, buildings, or automobiles, where repeated elements abound.
Fred Brooks, Jr.
Return to: Universe of Discourse main page | What's new page
mjd@plover.com
-calculus or How to write a 163-line program to compute 1+1.