David Marshall's Perl Portfolio
This page is a brief survey of various Perl scripts and
modules that I have written over the years. It is usually the
case that they feature coding styles that I have since
modified, but they give a general overview of my
- For whatever reason, it was the convention at
enews.com to use 132 columns rather than 80, so these
files are very wide.
- All code in this section is the property of
enews.com and is presented here solely for the purpose
of illustrating my coding experience. Don't be a bad
person by stealing it.
My perl-fu got a lot stronger after I found myself in the
enews.com Perl crucible. The code base when I arrived was very
fragile and not particularly maintainable. For instance, the
similar tasks of loading orders from various strategic
partners was performed in separately maintained
modules that had commonality decreasing over time.
My primary maintenance activity was a continuing effort to
move specific application processing into more general library
- dozens of scripts were opening their own pipes and
instituting various levels of process control. This
module was the result of many experiments in opening
pipes to defective processes.
- one of my favorite modules to keep tweaking, this
contains some of the basic list manipulations that
everyone implements. It duplicates some of the
processing that DBI performs, but we weren't using
- the solution for simplifying some very complicated
- nearly every legacy script was doing its own thing in
determining its name, when it started, etc. This
module centralized such processing.
- even more annoyingly, several scripts were trying
to ensure that only one instance of the script
could run at once. This module incorporated a
common technique for preventing duplicate
- as mentioned above, every partner's orders were being
loaded using a completely separate module.
GenericLoader and StandardLoader were the products of a
lot of thought into creating a set of classes to do the
loading so that each partner's module would include
only necessary information. New partners' modules were
once scoped at about three weeks for implementation and
testing; these modules reduced that time to about
thirty minutes needed to create a customized loader for
a new partner.
- an excerpt from a big collection of utility functions. The only one of
which I am proud/ashamed is the awful majesty that is luhn_sum.
- a general purpose script that was used to send out
our affiliate newsletter.
- the last script I wrote before the end. It's the
culmination of my sick affinity for "use constant," but
it has a nice big closure that I like.
- mongocheck - a
quick script I wrote one day when I grew tired of the
habit of another person to check in broken code on a
regular basis. This script checks out a copy of the
code for a particular tag and verifies that everything
Here are a few scripts that I have written more recently.