Hello Monks,

I'm getting an error which I believe I'm trying to use a hash which consist of a number and compare to see if that number is given. If it is, then I want to print out a string. Unfortunately, I get this error:

Argument "2EN" isn't numeric in eq at Calsdiscrete.pl line 71

This is my code:
if (($cals_info {$cals_type} {low_count_no} == $cals_info {$cals_type} {high_count_no}) == 0){<br> print ($cals_info {$cals_type} {$cals_state_0});<br> }<br> else<br> { <br> if (($cals_info {$cals_type} {low_count_no} == $cals_info {$cals_type} {high_count_no}) == 1){ <br> print ($cals_info {$cals_type} {$cals_state_1});<br> }<br> }<br>
Can you tell me what I'm doing wrong?
My text file is this:
"A1","BL1CHILDB0","0","0","OFF" "A1","BL1CHILDB0","1","1","ON" "A1","BL1CHILDB1","0","0","DIS" "A1","BL1CHILDB1","1","1","ENA" "A1","BL1CHILDB2","0","0","ZERO" "A1","BL1CHILDB2","1","1","ONE" "A1","BL1CHILDB3","0","0","DAN" "A1","BL1CHILDB3","1","1","JOHN" "A1","BL1CHILDB4","0","0","RICH" "A1","BL1CHILDB4","1","1","MARK" "A1","BL2CHILDB5","0","0","OFF" "A1","BL2CHILDB5","1","1","ON" "A1","BL2CHILDB6","0","0","OFF" "A1","BL2CHILDB6","1","1","ON" "A1","D1CHILDB0","0","0","OFF" "A1","D1CHILDB0","1","1","ON" "A1","D2CHILDB1T3","0","3","0T3" "A1","D2CHILDB1T3","4","5","4T5" "A1","D2CHILDB1T3","6","7","6T7" "A1","D3CHILDB4T5","0","0","DIS" "A1","D3CHILDB4T5","1","1","1EN" "A1","D3CHILDB4T5","2","2","2EN" "A1","D3CHILDB4T5","3","3","12EN" "A1","D4CHILDB6","0","0","OFF" "A1","D4CHILDB6","1","1","ON"
I'm reading the two columns of numbers and I want to print the last column. ex. (on,off)

203-06-21 edit ybiC: <tt>, <code> and <p> tags


In reply to 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.