Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
* Slightly OT: Perl question
@ 2003-03-15 19:24 John Ackermann N8UR
  2003-03-15 22:46 ` Hamish Moffatt
  0 siblings, 1 reply; 3+ messages in thread
From: John Ackermann N8UR @ 2003-03-15 19:24 UTC (permalink / raw)
  To: linux-hams

Hi --

Sorry if this is a bit off-topic.

I need to do some bit-level manipulation in a perl program I'm writing to 
capture data from a frequency counter via GPIB.  I have dug around through 
the Camel Book and done some googling, but I haven't been able to find a 
straightforward way to take care of (what should be) straightforward tasks.

I need to:

(a) test whether one bit of a byte is set or not (e..g, is bit 5 of $myvar 
a 1 or a 0);

and

(b) do a binary AND of two bytes (in other words, apply a bitmask).

I'd sure appreciate a  perl snippet or two showing efficient ways to do 
these things.

Thanks,

John

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-15 22:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-15 19:24 Slightly OT: Perl question John Ackermann N8UR
2003-03-15 22:46 ` Hamish Moffatt
2003-03-15 22:54   ` John Ackermann N8UR

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox