#!/usr/bin/perl use strict; use warnings; #### use CGI; use CGI::Carp qw(fatalsToBrowser); #### print "content-type: text/html \n\n"; #### my @Dice = ( roll '1d4', roll '1d6', roll '1d8', roll '1d10', roll '1d12', roll '1d20' ); my @Dice2 = qw(1d4 1d6 1d8 1d10 1d12 1d20); #### my @Dice = qw(1d4 1d6 1d8 1d10 1d12 1d20); my @Roll = map { roll($_) } @Dice; #### my @Radius = ( "1' or Touch", "5'", "10'", "20'", "50'", "100'" ); my $radius = "in a $Radius[rand @Radius] radius"; #### my @Wizard_School = qw(Abjuration Air Alteration Conjuration/Summoning Divination Earth Enchantment/Charm Fire Illusion/Phantasm Invocation/Evocation Necromancy Water); my @Cleric_Sphere = qw(Air All Animal Astral Chaos Charm Combat Creation Divination Earth Fire Guardian Healing Law Necromatic Numbers Plant Protection Summoning Sun Thought Time Travelers War Wards Water Weather); my @Spell_Freq = ( "common", "uncommon", "rare", "very rare" ); #### sub load_array_data { my ($file, $array) = @_; open(my $fh, '<', $file) or die "Unable to open '$file' for reading: $!"; while (<$fh>) { chomp; push @$array, $_; } } my @Wizard_School; load_array_data('wizard.data', \@Wizard_School); #### my @Colors = ( "f00;\">red", "ff0;\">yellow", "0f0;\">green", "0ff;\">cyan", "00f;\">blue", "f0f;\">magenta", "fff;\">white", "000;\">black" ); #### my %color = ( blue => 1, green => 2, yellow => 3 red => 4, orange => 5, purple => 6 ); print "The code for green is $color{green}\n";