.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Data::HexDump 3pm" .TH Data::HexDump 3pm "2022-10-22" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Data::HexDump \- Hexadecial Dumper .SH "SYNOPSIS" .IX Header "SYNOPSIS" Functional interface: .PP .Vb 2 \& use Data::HexDump; \& print HexDump($data_string); .Ve .PP \&\s-1OO\s0 interface: .PP .Vb 3 \& use Data::HexDump; \& my $dumper = Data::HexDump\->new(); \& print while $_ = $dumper\->dump; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module will generate a hexadecimal dump of a data string or file. You can either use the exported function, as shown in the \s-1SYNOPSIS\s0 above, or the \s-1OO\s0 interface, described below. .PP The second example from the \s-1SYNOPSIS\s0 generated this output: .PP .Vb 1 \& 00 01 02 03 04 05 06 07 \- 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF \& \& 00000000 23 21 2F 75 73 72 2F 62 \- 69 6E 2F 70 65 72 6C 0A #!/usr/bin/perl. \& 00000010 75 73 65 20 73 74 72 69 \- 63 74 3B 0A 75 73 65 20 use strict;.use \& 00000020 77 61 72 6E 69 6E 67 73 \- 3B 0A 0A 70 72 69 6E 74 warnings;..print \& 00000030 20 22 48 65 6C 6C 6F 2C \- 20 77 6F 72 6C 64 5C 6E "Hello, world\en \& 00000040 22 3B 0A ";. .Ve .PP The result is returned in a string. Each line of the result consists of the offset in the source in the leftmost column of each line, followed by one or more columns of data from the source in hexadecimal. The rightmost column of each line shows the printable characters (all others are shown as single dots). .SS "Functional Interface" .IX Subsection "Functional Interface" This module exports a single function, \f(CW\*(C`HexDump\*(C'\fR, which takes a scalar value and returns a string which contains the hexdump of the passed data. .SS "\s-1OO\s0 Interface" .IX Subsection "OO Interface" You first construct a \f(CW\*(C`Data::HexDump\*(C'\fR object, then tell it where to get the data from, and then generate the hex dump: .PP .Vb 1 \& my $dh = Data::HexDump\->new(); \& \& $dh\->data($scalar); # dump the data in this scalar \& $dh\->fh($fh); # read this filehandle \& $dh\->file($filename); # read this file and dump contents \& \& print while $_ = $dh\->dump; .Ve .PP The different potential sources for data are considered in the order given above, so if you pass to the \f(CW\*(C`data\*(C'\fR method, then any subsequent calls to \f(CW\*(C`fh()\*(C'\fR or \f(CW\*(C`file()\*(C'\fR will have no effect. .SH "SEE ALSO" .IX Header "SEE ALSO" Data::Hexify, by Johan Vromans, is another simple option, similar to this module. Last release in 2004. .PP Data::Hexdumper (by David Cantrell, \s-1DCANTRELL\s0) is another hex dumper, with more features than this module. .PP App::colourhexdump (by Kent Fredric, \s-1RIP\s0) provides a script which gives colourised output with character class highlighting. .PP Data::HexDump::Range provides more functions, colour output, and the ability to skip uninteresting parts of the input data. .PP Data::HexDump::XXD provides hex dumps like xxd. It doesn't say what xxd is, or provide a link, and there's no example output. But if you know and like xxd, this might be the one for you! .PP Devel::Hexdump provides some configuration options, but there are other more featured modules, and this one doesn't have example output in the doc. .PP Data::Peek is a collection of functions for displaying data, including \f(CW\*(C`DHexDump\*(C'\fR which generates a simple hex dump from a string. .PP String::HexConvert will convert \s-1ASCII\s0 strings to hex and reverse. .SH "AUTHOR" .IX Header "AUTHOR" Fabien Tassin .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 1998\-1999 Fabien Tassin. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.