Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Dec to Hex (NON-ASCII mode )

by samarzone (Pilgrim)
on Dec 09, 2010 at 09:10 UTC ( #876210=note: print w/ replies, xml ) Need Help??


in reply to Dec to Hex (NON-ASCII mode )

sprintf returns a string so if you try to get ascii value of returned string, you get value of character "6" and "4" rather than that of 6 and 4.

Not completely sure what do you want to do but if you want to get a binary representation of 100(dec) in a string you can use "%b"

perl -le '$_ = sprintf("%b", 100);print'

Output:

1100100


Comment on Re: Dec to Hex (NON-ASCII mode )
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-07-30 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (235 votes), past polls