OK, so maybe writing a perl script over the holiday WASN'T my greatest idea, but...(the honey-do list not withstanding) I had a super time. Now it's back to questions... FunkyMonk- I tried your suggestion & had some success, but it seems I don't get the proper result when I try to use something like my $x = ob01001001. I'm on a windows XP box, would that make a difference? I'm trying to print a 12 byte UPC Code from a 6 byte BCD field. I think I understand the shifting (>>) of the 4 bits, but when I try $hi=($x & 0b11110000).. 4; I think I need to "OR" it with 0x30 inorder to get the ASCII digit. ie 0101 0000 shifted = 0000 0101, then an ASCII digit of 5 would actually be 0x35 or 00110101, am I way off here? Then I would join the 12 bytes into a string for printing. When I OR it all I end up with is the 0x30 or 48dec. Thanks for the help, & your patience. BTW I have 2 perl books - the Gecko & the Black Panther. I'm thinking I neeed one in between. Does anyone recomend the camel vs llama books (I can only afford ONE of them right now.) Thanks.

In reply to Re: Testing & Using Bits by Anonymous Monk
in thread Testing & Using Bits by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.