NAME

plha / plhasa - command line tool for .lzh/.lha archives

SYNOPSIS

plha [options] <command> archive.lzh [files...]

plha l archive.lzh          # terse list (LhA l format)
plha v archive.lzh          # verbose list (LhA v format)
plha vv archive.lzh         # full verbose list (LhA vv format)
plha x archive.lzh          # extract all files
plha x archive.lzh foo.txt  # extract a specific file
plha t archive.lzh          # test archive integrity
plha d archive.lzh          # dump raw header data

# lhasa-compatible interface (via symlink)
plhasa l archive.lzh        # terse list (lhasa l format, with PERMSSN column)
plhasa v archive.lzh        # verbose list (lhasa v format, with METHOD and CRC)
plhasa x archive.lzh        # extract

# Override filename charset
plha --from-charset cp932 --to-charset UTF-8 v archive.lzh
plha -fc iso-8859-15 v archive.lzh

DESCRIPTION

plha reads and extracts LZH/LHA archives using Amiga LhA-compatible output formats. It supports header levels 0, 1 and 2, and decompression methods lh0 (stored), lh5, lh6 and lh7.

plhasa is a symlink to plha. When the script detects it is invoked as plhasa, it switches to a lhasa-compatible interface with different listing formats (l = terse with PERMSSN column, v = verbose with METHOD and CRC) and lhasa-style argument parsing ([-]{lvtxep...} prefix).

COMMANDS

l

List archive contents in LhA terse format: one filename per line, with a + prefix for files that contain a directory path component.

v

List archive contents in LhA verbose format: size, packed size, ratio, date, time and name.

vv

List archive contents in LhA full verbose format: size, packed size, ratio, date, time, attributes, compression method, CRC, header level, OS and name.

x

Extract files from the archive. If file names are given, only those are extracted; otherwise all files are extracted.

t

Test the integrity of all files in the archive by decoding and checking CRC.

d

Dump the raw parsed header data for each entry (for debugging).

OPTIONS

-fc charset, --from-charset charset

Specify the character encoding of filenames stored in the archive. Defaults to auto-detection based on the OS field in the archive header:

Amiga (a)        -> iso-8859-15
MS-DOS/Win (M/w) -> cp1252
Unix (U)         -> guess (Encode::Guess)
Human68K (H/J)   -> cp932

If the OS field is absent or unrecognised, Encode::Guess is used to probe for latin1, latin2, cp932 and euc-jp.

Supported charset names are those accepted by Encode. Run perl -MEncode -e 'print join "\n", Encode-encodings(":all")'> for a full list.

-tc charset, --to-charset charset

Specify the output character encoding for displayed filenames. Defaults to UTF-8.

--use-locale

Use the system locale for month name abbreviations in date output. By default, month names are always displayed in English (equivalent to LC_TIME=C), matching the behaviour of lhasa and LhA for UNIX, which both hardcode English month abbreviations.

SEE ALSO

Archive::Lha, Encode

AUTHOR

Nicolas Mendoza <mendoza@pvv.ntnu.no>

LICENSE AND COPYRIGHT

Copyright (c) 2025-2026 Nicolas Mendoza <mendoza@pvv.ntnu.no>.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.