Re: Just askin'...
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Wed, 18 May 2011 10:42:48 -0700
"Joey@xxxxxxxxxxxxxxxxxxxxxx" <Joey@xxxxxxxxxxxxxxxxxxxxxx> writes:
Trying to learn...
I create a variable, say $abc, by setting bits. Later, I want to test
whether any of the first several bits are set. I tried $abc && 191, but
always get 191. If I compare $abc & 191, I get the correct result. Why do
I have to do a bit comparison?
You have to do a bit comparison because you're comparing bits.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- Follow-Ups:
- Re: Just askin'...
- From: Joey@xxxxxxxxxxxxxxxxxxxxxx
- Re: Just askin'...
- References:
- Just askin'...
- From: Joey@xxxxxxxxxxxxxxxxxxxxxx
- Just askin'...
- Prev by Date: FAQ 6.4 How do I match XML, HTML, or other nasty, ugly things with a regex?
- Next by Date: Re: "Bareword found" in 'print $fh fun();'
- Previous by thread: Re: Just askin'...
- Next by thread: Re: Just askin'...
- Index(es):