in reply to Running a Sub for a Text File
ne and eq and gt and lt and cmp (and others) are designed for comparing strings... and though it probably won't hurt you here, you probably want to get in the habit of using == and != when comparing numbers instead of strings. Otherwise you may have problems if you have:if ($linescore eq 0){ linescore($y, $l); $y = $x; } if ($linescore ne 0){
because 02 as a string is not equal to 2 as a string...$_ = '02'; print "equal\n" if $_ eq 2;
|
|---|