Slightly OT: Perl question

From: John Ackermann N8UR (lrmwwqal.xhsnlore@hvdata.net)
Date: Sat Mar 15 2003 - 21:24:47 EET

  • Next message: Hamish Moffatt: "Re: Slightly OT: Perl question"

    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to xuarnn.euezu@pragerfenton.com
    More majordomo info at http://vger.kernel.org/majordomo-info.html



    This archive was generated by hypermail 2b30 : Sat Mar 15 2003 - 21:24:59 EET