Perl has some really great tools for dumping datastructures when debugging. Data::Printer by GARU is a realitive new comer that’s gained a tremendous following. Of course, everyone also knows Data::Dumper, core since at least perl 5.5 in 2004. What do you do when you need to dump binary data though?
I recently had to do this for the first time so I went looking on the CPAN to see what was available. I found two modules that both made dumping binary data simple. Data:HexDump and a more recently updated Data::HexDumper. Both have similiary simple usage:
but both were two much typing for a lazy Perl developer. I ended up installing and switching over to Data:HexDump. This module has no configurable options but didn’t generate warnings with my sample data.
For simple situations, Data:HexDump seems a suitable choice at 4k. Even you want control over the output, and there is lots of control offered, Data::HexDumper does it in only 13.6K.