Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Encoding BCD

by Corion (Patriarch)
on Jun 13, 2007 at 15:49 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://621007]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-19 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found