Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am stuck a piece of pie. I am trying to convert a hex string into ASCII characters and can't seem to find my way out.
while(<DATA>) { $flag = 0; $line = $_; $line =~ s/\s//g; send(SOCKET, $line, $flag); } __DATA__ 41 42 43 44 45 46 47 48 49 # ASCII: A B C D E F G H I
My problem here is I want to have "41" converted to "A" before being send. However, my current code is sending the characters 4 1 ... and so on as individual charaters. Could any monk kindly help me solve this problem?
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting Hex String ASCII Char
by pc88mxer (Vicar) on Apr 30, 2008 at 17:15 UTC | |
|
Re: Converting Hex String ASCII Char
by kyle (Abbot) on Apr 30, 2008 at 17:27 UTC | |
|
Re: Converting Hex String ASCII Char
by tuxz0r (Pilgrim) on Apr 30, 2008 at 17:30 UTC | |
by kyle (Abbot) on Apr 30, 2008 at 17:44 UTC | |
by tuxz0r (Pilgrim) on Apr 30, 2008 at 18:25 UTC |