NAME
Archive::Lha - extract .LZH archives
SYNOPSIS
my $stream = Archive::Lha::Stream->new(file => 'some.lzh');
while (defined(my $level = $stream->search_header)) {
my $header = Archive::Lha::Header->new(
level => $level,
stream => $stream,
);
$stream->seek($header->data_top);
my $decoder = Archive::Lha::Decode->new(
header => $header,
read => sub { stream->read(@_) },
write => sub { print @_ },
);
my $crc = $decoder->decode;
die "crc mismatch" if $crc != $header->crc16;
}
DESCRIPTION
LHa family is one of the lagacy but prevailing (and historically important) archivers. Though it has lost former popularity, it is still used widely in Japan, and reportedly, in Amiga world. And we have lots of LHa archives created under various environments at hand.
This package offers rather crude methods to decode/extract files from LHa archives. As of writing this, I'm not inclined to support creating/updating archives for various reasons but this may change. As for decoding, I'll probably add if testable (and preferably uploadable) archives should be found or offered.
ACKNOWLEDGMENT
The decoding (XS) part is based on the C sources of LHa for UNIX version 1.14i-ac20050924p1. Though I modified a lot not only to XSify but also to make it (relatively) thread-safe and easy to understand, I'm not fair if I omit the names of the original authors/contributors. If you find this port valuable, kudos be to them. If you find something wrong, most probably that'd be my fault.
According to the original C sources, those parts of LHa for UNIX version 1.14i-ac20050924p1 are copyrighted by Nobutaka Watazaki (1993-1995), Tsugio Okamoto (1996-2000?), and Koji Arai (2002-). I'm grateful to them, and also to all the people who involved in the development of LHa family including Masaru Oki, Yoichi Tagawa, Haruhiko Okumura, Haruyasu Yoshizaki, Kazuhiko Miki and others.
Other parts including a header file and perl sources are mine or of contributor(s) to this perl port. See appropriate POD sections for details.
SEE ALSO
Most of these are written in Japanese.
- http://sourceforge.jp/projects/lha/ (LHa for UNIX project)
- http://homepage1.nifty.com/dangan/en/Content/Program/Java/jLHA/Notes/Notes.html for details of LHa headers (en).
- http://lha.sourceforge.jp/history.html for the history of LHa (for UNIX).
- http://oku.edu.mie-u.ac.jp/~okumura/compression/oldstory.html for the older history of LHa/LHarc
AUTHOR
Kenichi Ishigaki, <ishigaki@cpan.org>.
COPYRIGHT AND LICENSE
Copyright (C) 2007 by Kenichi Ishigaki, unless otherwise noted. See above.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.