Generate and Execute: A Paradigm for Perl Programs

By Wolfgang Laun
Date: Wednesday August 13, 2008 13:30
Duration: 30 minutes

You can find more information on the speaker's site:


This paper outlines techniques that are highly useful for a class of programs, their common characteristic being that they process their input data while being driven by a set of commands, The general idea is, of course, to translate the set of commands into Perl code, and to use Perl's capability of extending a running program, at any time, with the eval function being the basic workhorse. This article reports some experiences and techniques in connection with this approach that were gained while implementing sed, cut, lex, m4 and od in Perl.

The main part of the paper deals with various programming techniques: managing alternatives, separating compile time and runtime variables, avoiding loops, etc.

The author's implementations of cut, od and sed are compared with the C versions on Linux. Are the C implementations always faster?

Attended by: