From: dbe AT wgn DOT net ($Bill Luebkert) Subject: Re: opposite. 20 Jan 1998 23:26:38 -0800 Message-ID: <34C3D130.EADD15D4.cygnus.gnu-win32@wgn.net> References: <2A89ACC39E45D111A61A00805FC1EDD9035132 AT us-sd-pt-loma-tech-dms DOT saic DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: "mark.g.franz" , "gnu-win32 AT cygnus DOT 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 () { > 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/ -/-' /___/_<_