[comp.lang.perl] Perl-Users Digest #448, "comparing bitmasks"

eichin@athena.mit.edu (Mark W. Eichin) (10/29/90)

Thanks for the [quick!] response...

|>If I were doing this, I'd probably maintain my $rin and $win over
|>multiple calls, and just vec in and out the proper bits only when necessary.
	Indeed, I have no idea why it didn't occur to me to simply vec() $rin
and $win directly, except that I was following the example in theman page too
closely.

|>:   if($xx eq "")
|>I suspect that one was always false.
	Correct.

|>: throwing in a ($vxx)=unpack("c",$xx) made 
|>:   if($vxx)
|>: true as long as the bit being masked was less than 8 (ie in the first
|>: byte, which make sense...)
|>
|>It should be true even if the bit is 8 or above--the null string is supposed
|>to be true.  If it's not, it's a bug.  When I say
	Sorry, had it reversed... if any of the first 8 bits are set,
if($vxx) is false, if not it's true. On further reflection, unpack("L",$xx)
should have gotten me the first 32 bits, right?
	[The application, in this case, is a version of "finger" that takes a
list of machine names and fingers them all in parallel (at least as parallel
as the limit on file descriptors allows.)]
			_Mark_  <eichin@athena.mit.edu>
				<eichin@apollo.hp.com>