Mail Archives: cygwin/1998/01/20/23:26:38
mark.g.franz wrote:
>
> I had a difficult time getting 'ne' to work on a script last week, I
> ended up setting a quick variable, then checking to see that it wasn't
> true,
>
> while (<DATA>) {
> if ($name eq $uname) {
> $nodata = "no"; # This is important, tricks the system to check
> for a match, if none found, then run MORE STUFF
> print STUFF "
> "
> last;
> } # end if
> else {
> $nodata = "yes";
> } #end else;
> } # End WHILE
> close DATA;
> if ($nodata eq "yes") {
> print MORE STUFF"
> "
> } # End IF
This makes no sense at all. If "ne" fails, (ie: skips to } or else), it's because the
2 strings are the same. The same is true for "eq", if it fails and goes to }
or else, it's because the 2 strings don't match.
The main reason for people thinking they are failing, is probably because
there is "invisible" stuff in one or both strings causing an apparent
failure of the if when really the failure is not a failure at all but
just a match/mismatch (depending on whether you're using eq or ne) in the
2 strings.
I challenge you to post a script that fails eq or ne when it shouldn't.
Make sure you provide the data file if not local data.
--
,-/- __ _ _ $Bill Luebkert
(_/ / ) // // DBE Collectibles
/ ) /--< o // // http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_ Mailto:dbe AT wgn DOT net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -