Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Just askin'...
May 18, 2011, 2:23 am
rate this thread
Re: Just askin'...
JLi> I create a variable, say $abc, by setting bits. Later, I want to
JLi> test whether any of the first several bits are set. I tried $abc
JLi> && 191, but always get 191. If I compare $abc & 191, I get the
JLi> correct result. Why do I have to do a bit comparison?
read perldoc perlop. & and && are VERY different operators. and you
should use hex, octal or even binary constants to deal with
bits. decimals are not easy to convert in our heads to bit masks.
Uri Guttman ------ email@example.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
- » FAQ 9.23 How do I find out my hostname, domainname, or IP address?
- — Next thread in » PERL Discussions