For one thing, you want to learn about using the <code> tag when posting code or other stuff that should look like code.

For another thing, your "if" expressions are much more verbose than they should be. Assuming that "low_count_no" and "high_count_no" are supposed to refer to the values of the third and fourth columns in your data file (e.g. numeric values 0 and 3 respectively, for this line: "A1","D2CHILDB1T3","0","3","0T3") -- and assuming that you are parsing the file correctly when you load it into your data structure -- your logic would normally look like this:

if ($cals_info{$cals_type}{low_count_no} != $cals_info{$cals_type}{hig +h_count_no}) { print $cals_info{$cals_type}{$cals_state_0}; } else { print $cals_info{$cals_type}{$cals_state_1}; }
Though for cases like this, I personally prefer to use the ternary operator:
print ($cals_info{$cals_type}{low_count_no} != $cals_info{$cals_type}{ +high_count_no}) ? $cals_info{$cals_type}{$cals_state_0} : $cals_info{$cals_type}{$cals_state_1};
But, as suggested in the earlier reply, the error report you're getting suggests that you are not parsing the data file correctly, and for at least the line that has "2EN" in it (if not other lines as well), one of those "count_no" elements is holding that last field, instead of the intended digit value.

In reply to Re: Using Hashes by graff
in thread Using Hashes by Anonymous Monk

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.