Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Binary Coded Decimal

by tobyink (Abbot)
on Sep 18, 2012 at 00:58 UTC ( #994159=note: print w/ replies, xml ) Need Help??


in reply to Binary Coded Decimal

sub bcd { local $_ = shift; # enforce two digits $_ = "0$_" while 2 > length; die "too big" unless m{^(\d)(\d)$}; return chr(16*$1 + $2); }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Binary Coded Decimal
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2014-10-26 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls