Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Need a little coding help

by biohisham (Priest)
on Nov 25, 2010 at 22:52 UTC ( #873737=note: print w/replies, xml ) Need Help??


in reply to Need a little coding help

pack and unpack can just let you do what you want, in Perl there is not like an intrinsic way to convert between binary and decimal but pack and unpack can allow you to do the interchanging...
my $decimal = 4; $binary=unpack("B32", pack("N",$decimal)); print $binary; print "\n"; my $newdecimal=unpack("N",pack("B32",$binary)); print $newdecimal; # 32 in the template means the binary number will have 32 places



Excellence is an Endeavor of Persistence. A Year-Old Monk :D .

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://873737]
help
Chatterbox?
[Discipulus]: long live to cookies maker!
Discipulus or is long life?
Lady_Aleena giggles.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-04-26 08:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (471 votes). Check out past polls.