
BillKSmith
Veteran
Nov 5, 2012, 8:22 PM
Post #2 of 3
(887 views)
|
|
Re: [Csmith] ASCII hex to binary bits
[In reply to]
|
Can't Post
|
|
I find pack and unpack to be about the hardest perl language feature that there is. I have tried this on perl v8.14.
use strict; use warnings; my $line = "01 23 45 67 89 ab cd ef\n"; my $packed = pack 'H2' x 8, split( / /, $line ); print unpack( 'H*', $packed ); If you are sending the packed string to another computer, you still must worry about the "endian" issues. Good Luck, Bill
|