Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: how to convert latin alphabets to hexadecimal number

by kennethk (Abbot)
on May 01, 2013 at 14:16 UTC ( #1031573=note: print w/ replies, xml ) Need Help??

in reply to how to convert latin alphabets to hexadecimal number

In your format string, you use double quotes with an unescaped backslash. Change line 13 to printf ('\u%X ', ord($_)); to get your desired output.

A little cleaner might be to swap lines 13 and 14 to printf "\\u%X\n\n", ord;

Better still, of course, is to use a package to do interpolation, as the other comments suggest, or actually encode your inputs and outputs properly (perlunitut).

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2016-07-25 20:40 GMT
Find Nodes?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?

    Results (227 votes). Check out past polls.