I've come across an interesting twist. We were sent a Perl script by our vendor and when I tried to run it, it choked on one particular line.

This is what I got for an error message:

Bareword found where operator expected at prog.pl line 1544, near ") NE" (Missing operator before NE?) syntax error at prog.pl line 1544, near ") NE " syntax error at prog.pl line 1548, near "else" Execution of dni aborted due to compilation errors.

This is what they are trying:

while (($var1 = index ($var2, $var3)) NE -1 )
Now, I didn't fully check things out and concluded that they had meant to do != instead of NE. I didn't realize that "ne" was a string comparison, not a numeric even though it looked like they were trying to do a numeric comparison. I substituted in != and everything ran fine. However, I had an email from tech support that the version of Perl I was looking at (ActivePerl 5.8.0) didn't like the "NE" and that I should put in "ne" instead. I did this and it worked just fine. The only versions of Perl that I've looked at have been 5.8.0 (Windows and Unix, same errors with the "NE"). I checked through the Camel book and only find "ne" not "NE." Is there really a difference between the two? or am I losing it? Is there something perhaps in later builds of 5.8.0 that would account for this issue? Any thoughts anyone?


"Ex Libris un Peut de Tout"

In reply to Problem with case sensitivity? by nimdokk

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.