Skip to content

Thinking of an Animal, Part 2

I’ve been continuing my studies of Perl and have been adding to the script, ThinkingOfAnimals.pl. I’ve added some modules that extrapolate out some functionality. IO_LIB.pm contains methods for writing to and reading from a file, and LOGIT.pm which makes a Log file and then appends it using IO_LIB of course.

So now you need two modules and the main file to run the script, plus you wind up with a nice file called Log that gets created and then recreated every time you play the game. I figured out how to add command line options in Perl and now the game can be run in Debug Mode by adding – -debug to it when called from the command line: perl ThinkingOfAnimals.pl – -debug

Leave a Reply

Your email address will not be published. Required fields are marked *