Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: I need Hex conversion, not!

by blue_cowdawg (Monsignor)
on Jan 07, 2013 at 13:09 UTC ( #1012026=note: print w/ replies, xml ) Need Help??

in reply to I need Hex conversion, not!

      I need to use hex numbers for something but when I assign hex number to something

Your point is...?

If you want to print as hex you need to use the format string as you show in your second example...


If you don't want to do that "everywhere" you can always create a sub such that:

| hand waving here... my $n = 0x85; printf "and the majic number is: %s\n",as_hex($n); | more handwaving exit(0); sub as_hex{ my $x=shift; sprintf "%X",$x; }

Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-11-30 22:23 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (788 votes), past polls