Dear Perl Power Tools Programmers,

I was so glad to hear about the Perl Power tools project, and especially
that fortune was a part of it. When I saw Theo Van Dinter's strfile, I
got really excited because I've been looking for a cross-platform
version of both fortune and strfile.

I decided to try to make Andy Murren's fortune work with dat files, and
also to make sure all the options work together correctly. I don't know
if I've succeeded, but all my quickie tests seem to be working. I also
added the -n option for setting the length of short/long fortunes.

I've put the code online at:
http://www.eyeballsun.org/capmikee/perl/fortune.mike

I must apologize that almost nothing remains of the original code. I
wasn't able to get my head around the style and I ended up redoing it in
my own style, loosely based on the c code of the original BSD fortune. I
hope you will find it reasonably easy to read and modify.

I emailed Theo earlier because I discovered something weird about the
dat files on my system. Fink/Mac OS X fortune writes the file offsets
as 64-bit values, and thus makes it difficult to implement a
cross-platform fortune. I ended up checking the size of the dat file
and calculating the size of the offsets. I also found some differences
in the way offensive fortunes are identified. I've tried to support both
ways I saw, but only tested my machine, which keeps offensive files in
a separate directory.

Thank you again. I hope you find this update helpful.

- Mike Ciul

-- 
Hazards of New-Car Smell

New car interiors emit high levels of toxic chemicals for up to six
months, according to an Australian study, which found levels of
volatile organic compounds up to 128 times higher than recommended
exposure limits. "That's much higher than the levels we've seen in new
buildings, including buildings where people get sick," said Steve
Brown of the CSIRO, Australia's national research organization.

        - Roland Sweet, Newsquirks 657 January 22 2002

Reply via email to