in reply to What is the best method to print hex string in bin-file?
Or in the case of your example, something like this:my $bin_str = pack 'H*', $hex_st;
I often use this with qw() to keep the binary data nicely formatted:... if ( $pngData{$hashCode} ) { open MyPNG, '>', $hashCode or die "Write Error: $hashCode: +$!\n"; binmode MyPNG; print MyPNG pack 'H*', $pngData{$hashCode}; close MyPNG; } ...
my $bin_str = pack 'H*', join '', qw( 18 00 1B 00 21 00 00 01 0B 00 00 00 01 00 00 00 21 00 00 01 0B 00 00 00 01 00 00 00 18 00 1B 00 00 00 00 0D 3B 00 00 00 00 04 00 00 00 02 00 FF 00 01 0B 00 00 00 01 00 00 00 );
--
John.
|
|---|