in reply to How can I tell perl the element is number?

You need to use hex.

map {printf ("%c", hex $_)} split (',', $text);

By the way, I personally prefer not to use map in a void context like that. It produces a list, so use it. I might write the above this way:

print map { sprintf '%c', hex $_ } split q{,}, $text;

If you really want a simple loop, "for" is a good way to go.

printf '%c', hex $_ for split q{,}, $text;

Replies are listed 'Best First'.
Re^2: How can I tell perl the element is number?
by xiaoyafeng (Deacon) on Aug 13, 2007 at 07:03 UTC
    Thanks a lot!
    I didn't totally realized really meaning of hex and oct until today!
    And I'm happy to hear perl 6 will add number type.

    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction