perlfortune - Very basic fortune cookies, hacked in Perl
perlfortune [-help|-man|-build] <file ...>
- -help
-
Print brief help message
- -man
-
Show the manual page
- -build
-
Build index files
This is a command-line tool that implements functionality similar to the fortune(6) program. Snap it in an environment where you cannot have true fortune but you have at least version 5.10 of perl.
The text file format for the cookies is the same. However perlfortune uses its own index format. You can build the index files by passing the -build option. Then for each input file a corresponding .idx file is created.
When printing a fortune cookie first a file is chosen at randomly from the supplied list of input files. Only then a cookie is selected from that particular file. An alternative taking into account the number of cookies in each file may be implemented some time in the future. Handling of directories would be nice too.
More advanced features of the BSD fortune are not implemented.
fortune(6), fortune-mod