NAME
Hexdumper - A module for displaying binary data in a readable format
SYNOPSIS
use Data::Hexdumper; Data::Hexdumper::dump( data => $data, # what to dump number_format => 'S', # display as unsigned 'shorts' start_position => 100, # start at this offset ... end_position => 148 # ... and end at this offset );
DESCRIPTION
Data::Hexdumper
provides a simple way to format and display arbitary binary data in a way similar to how some debuggers do for lesser languages. It gives the programmer a considerable degree of flexibility in how the data is formatted, with sensible defaults. It is envisaged that it will primarily be of use for those wrestling alligators in the swamp of binary file formats, which is why it was written in the first place.
Data::Hexdumper
provides the following subroutine:
- Hexdump
-
Does everything :-) Takes a hash of parameters, one of which is mandatory, the rest having sensible defaults if not specified. Available parameters are:
- data
-
A scalar containing the binary data we're interested in. This is mandatory.
- start_position
-
An integer telling us where in
data
to start dumping. Defaults to the beginning ofdata
. - end_position
-
An integer telling us where in
data
to stop dumping. Defaults to the end ofdata
. - number_format
-
A character specifying how to format the data. This tells us whether the data consists of bytes, shorts (16-bit values), longs (32-bit values), and whether they are big- or little-endian. The permissible values are
C
,S
,n
,v
,L
,N
, andV
, having exactly the same meanings as they do inunpack
. It defaults to 'C'.
SEE ALSO
Data::HexDump if your needs are simple
perldoc -f unpack
perldoc -f pack
BUGS
If displaying data in 'short' or 'long' formats, the last element displayed may be screwed up if it does not end on the boundary of a short or a long - eg, if you try to display 39 bytes as longs.
AUTHOR
David Cantrell (david@cantrell.org.uk).
HISTORY
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 140:
You forgot a '=back' before '=head1'
You forgot a '=back' before '=head1'
- Around line 162:
'=item' outside of any '=over'
=over without closing =back