I thank you for the time you put into responding to my problem. The article you recomended certainly highlights a serious problem with using '$$variable'.

re: para2... I need the loop because I am testing and resetting the data depending on what is submitted, but thanks for the tip.

As to the rest of your comments, the code was there in an atttempt to highlight what I was trying to do. I know it's messy and I don't use variable names like those shown in those examples. I had preciously asked the question about declaring groups of variables but got no response. I had seen my ($firstvar, $secondvar, $thirdvar) used on this site and thought it was correct. I'll use our ($firstvar, $secondvar, $thirdvar) in future!

Example 3 is a messy attempt (that works) to get my $fieldname = $q->param('fieldname') for each field in the HTML doc while also checking and resetting the data within the loop. I didn't like it either.

Anyway, based on the responses above and your comments, I propose the use a hash as in example 4.


In reply to Re: Re: Creating variables while using 'strict' by nedals
in thread Creating variables while using 'strict' by nedals

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.