Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Chinese to Hex and Hex to Chinese

by Anonymous Monk
on Sep 05, 2017 at 14:21 UTC ( #1198694=note: print w/replies, xml ) Need Help??

in reply to Chinese to Hex and Hex to Chinese

Very nice. BTW, ascii_to_hex($str) is just unpack('H*', $str) and hex_to_ascii($str) is just pack('H*', $str). Those functions are incorrectly named because, as you've discovered, the input doesn't have to be ascii. pack is kind of tricky, but it would help you if you studied its ways.

Replies are listed 'Best First'.
Re^2: Chinese to Hex and Hex to Chinese
by thanos1983 (Vicar) on Sep 05, 2017 at 16:21 UTC

    Hello Anonymous Monk,

    Thanks for the time and effort, reviewing my script. You are absolutely right. I checked the source of the script and it is actually that simple.

    Well it is easier for me to use the lexical methods instead of creating my own subroutines and call them inside the script. But you gave me a nice idea on how to proceed.

    Thanks again for your time and effort, BR.

    Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1198694]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-07-19 04:29 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (402 votes). Check out past polls.