Data-HexDump-XXD
view release on metacpan or search on metacpan
lib/Data/HexDump/XXD.pm view on Meta::CPAN
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);
=head1 DESCRIPTION
Produce an hexadecimal dump like the program B<xxd> would do, and do the
reverse as well.
At the moment, only straight dumping is supported, and reverse assumes
the same.
=head1 INTERFACE
=over
=item B<my $dump = xxd($bindata);>
=item B<my @dump_lines = xxd($bindata);>
=item B<my $dump = xxd_unpack($bindata);>
=item B<my @dump_lines = xxd_unpack($bindata);>
Produce an hex dump of the input C<$bindata>. The dump can be either a
single string or a list of lines depending on the calling context.
C<xxd_unpack()> and C<xxd()> are synonimous.
=item B<my $bindata = xxd_r($dump);>
=item B<my $bindata = xxd_r(@dump_lines);>
=item B<my $bindata = xxd_pack($dump);>
=item B<my $bindata = xxd_pack(@dump_lines);>
Reverse an B<xxd>-style hexadecimal dump. You can either provide a single
string or an array of lines; in the first case, the line terminator
is assumed to be a single newline character. Like B<xxd>, the ASCII dump
is ignored and only the hexadecimal part is taken into account.
=back
=head1 CONFIGURATION AND ENVIRONMENT
Data::HexDump::XXD requires no configuration files or environment variables.
=head1 DEPENDENCIES
Among the non-core, only C<version>.
=head1 BUGS AND LIMITATIONS
It is currently limited to the basic behaviour of B<xxd>. Note that plain
hex dump is pretty straightforward in Perl, you simply have to call:
my $hex = unpack 'H*', $bindata;
Note also that the high nybble is always assumed to come first in
dumps (see C<perldoc -f unpack>, C<H> template).
No bugs have been reported.
Please report any bugs or feature requests through http://rt.cpan.org/
=head1 AUTHOR
Flavio Poletti C<< <flavio [at] polettix [dot] it> >>
=head1 LICENCE AND COPYRIGHT
Copyright (c) 2007, Flavio Poletti C<< <flavio [at] polettix [dot] it> >>. All rights reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>
and L<perlgpl>.
Questo modulo è software libero: potete ridistribuirlo e/o
modificarlo negli stessi termini di Perl stesso. Vedete anche
L<perlartistic> e L<perlgpl>.
=head1 DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
=head1 NEGAZIONE DELLA GARANZIA
Poiché questo software viene dato con una licenza gratuita, non
c'è alcuna garanzia associata ad esso, ai fini e per quanto permesso
dalle leggi applicabili. A meno di quanto possa essere specificato
( run in 1.938 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )