This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: opposite.
- To: "mark.g.franz" <MARK dot G dot FRANZ at cpmx dot mail dot saic dot com>, "gnu-win32 at cygnus dot com" <gnu-win32 at cygnus dot com>
- Subject: Re: opposite.
- From: "$Bill Luebkert" <dbe at wgn dot net>
- Date: Mon, 19 Jan 1998 14:18:24 -0800
- Organization: DBE Collectibles
- References: <2A89ACC39E45D111A61A00805FC1EDD9035132@us-sd-pt-loma-tech-dms.saic.com>
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@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".