Yes, having declared everything globally just to get the sod to work (work around my ignorance, that is), the penny has just dropped about why/where/how one should use local variables.

I have managed to get the script working, though am aware there are several things to be done to improve it, primarily in optimising email address validation, and in getting the form field values - oko1's and Jenda's words of wisdom, and indeed everyone else's, have given me much to meditate upon. Phrases like 'reinventing the loop' spring to mind, but it's useful practice for me.

I'm loth to post acres of pre-competent code here, but if anyone needs a shudder, do feel free to have a look at the form code and/or the Perl code.

I'm overwhelmed by the response from this forum, muchas gracias senors, mucho gusto. What started as an optimistic 2-hour hack of someone-else's code a week ago seems to be turning into an obsession.

Cheers, Jim


In reply to Re^2: variable sees it, array doesn't - stumped! by shrdlu
in thread variable sees it, array doesn't - stumped! by shrdlu

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.