Path: utzoo!attcan!uunet!lll-winken!uwm.edu!wuarchive!emory!gatech!mcnc!uvaarpa!mmdf From: eichin@athena.mit.edu (Mark W. Eichin) Newsgroups: comp.lang.perl Subject: Re: Perl-Users Digest #448, "comparing bitmasks" Message-ID: <1990Oct29.133539.21503@uvaarpa.Virginia.EDU> Date: 29 Oct 90 13:35:39 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: eichin@athena.mit.edu Organization: The Internet Lines: 27 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_