Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: I need Hex conversion, not!

by LanX (Canon)
on Jan 07, 2013 at 13:06 UTC ( #1012025=note: print w/ replies, xml ) Need Help??


in reply to I need Hex conversion, not!

> so what should I do ?

keep the hexnumbers as strings ...

DB<121> $SM = 0xFE; => 254 DB<122> $SM = "0xFE"; => "0xFE" DB<123> print $SM => 1 0xFE

...or write a subroutine printhex() which automatically fulfills your wishes by converting any numeric scalar to a hexstring before printing.

Cheers Rolf


Comment on Re: I need Hex conversion, not!
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2015-07-03 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls