Thank you for the fabulous breakdown of issues you see. Let me see if I understand them.

The first item is that you suggested that I add -T to the shebang line. I was already told to add -w (after reading perlrun, I may possibly go to -W instead). Can both be added to the shebang?

Do the following two items duplicate the same thing? If they do, I would choose to keep the first.

use CGI; use CGI::Carp qw(fatalsToBrowser);
print "content-type: text/html \n\n";

I now only have the following in my code...

my @Dice = qw(1d4 1d6 1d8 1d10 1d12 1d20);

@Dice2 became redundant.

You expressed concern for my variable names, with the example being @Radius and $radius. I have been using the capitalized version for the array in the original TableSmith version, and the lowercase version for the phrase fragment for a while now. I can tell the difference.

All of the data in the script is static. As far as I know the arrays will only change if I think of something to add to them and write it into the code manually. The only thing that will change is the amount of times the user wants to run the script and the amount of times each random element will be called. The script as it is now is only a fragment of what is yet to come. I have a lot of markup to add to make this into a web page. I also have several other sub scripts to write that will be used by this one (but each of those must stand alone as well).

The original way I wrote the array dealing with the colors was...

my @Color = ( "<span class=\"mut\" style=\"color:#f00;\">red</span>", "<span class=\"mut\" style=\"color:#ff0;\">yellow</span>", "<span class=\"mut\" style=\"color:#0f0;\">green</span>", "<span class=\"mut\" style=\"color:#0ff;\">cyan</span>", "<span class=\"mut\" style=\"color:#00f;\">blue</span>", "<span class=\"mut\" style=\"color:#f0f;\">magenta</span>", "<span class=\"mut\" style=\"color:#fff;\">white</span>", "<span class=\"mut\" style=\"color:#000;\">black</span>" );
I thought that this would save me a few bytes...
my @Colors = ( "f00;\">red", "ff0;\">yellow", "0f0;\">green", "0ff;\">cyan", "00f;\">blue", "f0f;\">magenta", "fff;\">white", "000;\">black" ); my $Color = "<span class=\"mut\" style=\"color:#$Colors[rand @Colors]< +/span>";
But you think a hash is better?
my %Colors = ( red =>f00, yellow =>ff0, green =>0f0, cyan =>0ff, blue =>00f, magenta =>f0f, white =>fff, black =>000 );
How would you make that randomly selected and inserted into the following?
<span class="mut" style="color:(color code)">(color name)</span>
As soon as I get the entire script working, I will be getting rid of all unnecessary whitespace from it. I just hope that this doesn't go above the amount of bytes I have alloted for it.

In reply to Re^3: Creating a random generator by Lady_Aleena
in thread Creating a random generator by Lady_Aleena

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.