Robbert Haarman



Perlcookies is a software package for displaying randomly selected text messages (fortune cookies). The cookies are stored in a format compatible with the traditional Unix fortune command.

Comparison with Traditional fortune

Many Unix-like systems contain a command named fortune(6) for displaying fortune cookies. These cookies are stored in a text file, with percent signs separating the cookies from one another. In addition to the text file, fortune requires an index file, which can be created using strfile(1). This saves memory and CPU time when displaying fortunes. Some distributions include another command named randstr that displays a cookie directly from the text file, without requiring an index file.

Perlcookies stores fortunes in the same format as fortune. Currently, only the randstr command is provided. This is sufficient for small collections of fortune cookies (a few hundred are no problem).


Perlcookies is available under the terms of the MIT License. The following downloads are available:

Version 0.2.0

This version adds support for the FORTUNEPATH environment variable, which allows the specification of directories in which to search for fortune files, and allows multiple fortune files to be specified. perlcookies-0.2.0.tar.bz2 (3417 bytes)

Version 0.1.0

This version is very simple and lightweight. randstr takes a filename from the command line, from the FORTUNES environment variable, or a built-in default, and displays a fortune cookie from that file. perlcookies-0.1.0.tar.bz2 (2796 bytes)

After downloading, refer to the README if you need further instructions.