Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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 imbibing at the Monastery: (7)
As of 2016-10-26 08:28 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (337 votes). Check out past polls.