ETOOBUSY 🚀 minimal blogging for the impatient
Data::HexDump::XXD
TL;DR
Data::HexDump::XXD can turn out useful.
A long time ago (almost 14 years!) I liked the output of vim’s utility xxd so much that I wrote a module to re-generate its output in Perl. This is where Data::HexDump::XXD comes from.
(Technically speaking I don’t know whether xxd is distributed as a part of vim, but it is surely distributed with vim).
The usage is pretty straightforward: feed it with bytes, get a string back. Or: feed it with a hex dump, get the bytes back. Like this:
use Data::HexDump::XXD qw( xxd xxd_r );
my $dump_string = xxd($binary_data);
my @dumped_lines = xxd($binary_data);
my $binary = xxd_r($xxd_like_string);
my $binary = xxd_r(@xxd_like_lines);
This is one of the modules from that had the most success so far: it is optionally used by another module if the user wants a hex dump of something. If you’re skeptical, take a look at Devel::StringInfo!
All this fame will make my ego explode one day or another 😄