Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Encoding BCD

by Corion (Pope)
on Jun 13, 2007 at 15:49 UTC ( #621007=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    if ($test1 = $test2) {
       $comp = "EQUALS";
    }  else  {
       $comp = "Does NOT Equal";
  2. or download this
    my $test1 = 123;
    my $test2 = 456;
       $comp = "Does NOT Equal";
    print "3. Test1: '$test1', test2: '$test2'\n";
  3. or download this
    =head2 C<decode_COMP3>
        else { $digits .= $sign; $sign = '?' };
  4. or download this
    sub decode_BCD {
        unpack "H*", $_[0];
  5. or download this
    use strict;
    use Test::More tests => 4;
    is decode_BCD("\x12\x34\x56","123456");
    is decode_BCD("\x00\x34\x56","003456");
    is decode_BCD("\x12","12");

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://621007]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-10-22 02:26 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.