The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Apache::Recorder - mod_perl handler to record HTTP sessions


The Apache::Recorder module is an implementation of a session recorder, much like a macro recorder that you might use with a GUI application. It allows you to "record" each of the clicks that you make during an http session for later playback. However, Apache::Recorder does not provide capabilities to "play-back" a recorded session. To "play-back" a session, you need two additional modules: (1) HTTP::RecordedSession to "thaw" the session, and format it appropriately; and (2) A module (such as HTTP::Monkeywrench or HTTP::WebTest) which wraps testing logic around the "thawed" session.

Apache::Recorder listens for a cookie which indicates that it should record the current session. If the cookie is not present, it immediately declines to handle the request. If the cookie is present, it acquires information about the current request, and writes that information to the file system using Storable.

After the user has finished recording their session, they may access the recorded session using HTTP::RecordedSession. HTTP::RecordedSession can format the session for use with HTTP::Monkeywrench or HTTP::WebTest. This makes the module very useful when creating regression tests.


Apache::Recorder is intended to work as a stand-alone mod_perl handler. As such, it does not export any functions. However, if you _really_ want to use its internal functions, here is the API:

write_config_file() calls Storable::lock_store() to serialize the most recent click.

It accepts four parameters, (1) the full path to the file where the "clicks" are going to be saved; (2) the URI that should be saved; (3) the request type; (4) any parameters that should be saved for the request;


Chris Brooks <>