Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    
  2. or download this
    use CGI;
    use CGI::Carp qw(fatalsToBrowser);
    
  3. or download this
    print "content-type: text/html \n\n";
    
  4. or download this
    my @Dice = (
    roll '1d4',
    ...
    roll '1d20'
    );
    my @Dice2 = qw(1d4 1d6 1d8 1d10 1d12 1d20);
    
  5. or download this
    my @Dice = qw(1d4 1d6 1d8 1d10 1d12 1d20);
    my @Roll = map { roll($_) } @Dice;
    
  6. or download this
    my @Radius = (
    "1' or Touch",
    ...
    "100'"
    );
    my $radius = "in a $Radius[rand @Radius] radius";
    
  7. or download this
    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 Creati
    +on Divination Earth Fire Guardian Healing Law Necromatic Numbers Plan
    +t Protection Summoning Sun Thought Time Travelers War Wards Water Wea
    +ther);
    ...
    "rare",
    "very rare"
    );
    
  8. or download this
    sub load_array_data {
        my ($file, $array) = @_;
    ...
    }
    my @Wizard_School;
    load_array_data('wizard.data', \@Wizard_School);
    
  9. or download this
    my @Colors = (
    "f00;\">red",
    ...
    "fff;\">white",
    "000;\">black"
    );
    
  10. or download this
    my %color = (
        blue => 1, green  => 2, yellow => 3
        red  => 4, orange => 5, purple => 6 
    );
    print "The code for green is $color{green}\n";