Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
My text file is this:
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:Can you tell me what I'm doing wrong?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>
My text file is this:
I'm reading the two columns of numbers and I want to print the last column. ex. (on,off)"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"
203-06-21 edit ybiC: <tt>, <code> and <p> tags
Back to
Seekers of Perl Wisdom