Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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 = '?' };
        "$sign$digits"
    };
    
  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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-10-25 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (143 votes), past polls