You are parsing your CGI input directly, and doing it in a broken way. What I was talking about is using the standard CGI module to parse your input for you, more flexibly, meeting the whole standard, without security holes, with support for file uploads, with support for command line debugging, etc, etc, etc. Read use CGI or die; for details on what people typically get wrong (yes, you made the typical mistakes), and for simple examples of how to use the module.

As for the problem you complained about, I already told you why you have the behaviour you do, and how to automatically catch the error that leads to it. And what I meant by saying that you're using an array instead of a hash is that you are using strings like '01' as indexes into an array. I strongly recommend either making that a hash, or just using numbers. As it stands your choice of index and data structure are passing conflicting messages. Experienced programmers see conflicts like that and label them as mistakes. What kind of mistake may not be obvious, but they are mistakes.

UPDATE
BTW you may find it better to just use a nested hash. For instance if you just assign your values like:

$STUDQT{'32000012'}{mname}[1] = 0;
without initializing $STUDQT{'32000012'}{mname}, Perl will no longer misbehave on you. (Of course strict.pm is still strongly recommended to catch other incidences of the same mistake. Catching bugs early is a Good Thing.)

In reply to Re (tilly) 3: associative array problem by tilly
in thread associative array problem by Gerryjun

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.