#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use CGI; use CGI::Carp qw(fatalsToBrowser); use HTML::Template; sub Disorder { my @Disorder = ('amnesia','catatonia','dementia','hallucinatory insanity','manic despression','paranoia','schizophrenia'); return $Disorder[rand @Disorder] } my %InsDesc = ( abluto=>'washing or bathing', acaro=>'ticks and mites, and the diseases they transmit', aero=>'air, atmosphere, weather, or gas', agro=>'agricultural soils, or open spaces', ailuro=>'cats', xeno=>'foreigners, strangers, foreign things, or outside causes', xero=>'dry conditions or dryness', xylo=>'wood, wooden objects, or forests', zoo=>'animals', zym=>'fermentation' ); sub Ins { my @InsKeys = keys %InsDesc; my $InsRand = $InsKeys[rand @InsKeys]; my @InsType = ( $InsRand."phobia (fear of ".$InsDesc{$InsRand}.")", $InsRand."mania (obsession of or with ".$InsDesc{$InsRand}.")", $InsRand."philia (insatiable desire for ".$InsDesc{$InsRand}.")" ); } sub Insanity { my @InsGen = (Disorder,Ins); return $InsGen[rand @InsGen]; } print Insanity; if (!caller) { print "This will only show up when run directly" };