Text::CHM(3)

πŸ“¦
version 0.01 Β· 2 versions
, in fedora 43

πŸ’– Text::CHM πŸ’–

okay bestie, gather round, because today we're talking about Text::CHM β€” a Perl extension for handling MS Compiled HtmlHelp Files. yes, those .chm files. the ones Windows docs live in. it's giving "I read the manual so you don't have to" energy, and honestly? iconic. πŸ‘‘

it's part of the User Contributed Perl Documentation, so you know it's the people's module. 🫢


✨ SYNOPSIS ✨

here's the whole vibe, copied exactly because I do not play with code:

use Text::CHM;
$chm = Text::CHM->new('foobar.chm');
print $chm->filename(), "\n";  # It will print "foobar.chm"
@content = $chm->get_filelist();

# I hope you don't really do this!
foreach $file ( @content )
  {
    pring $chm->get_object($file->{path});
  }

$chm->close();
not me leaving that pring in there β€” yeah, that's exactly what the original says, and I am not touching it. character for character, bestie. if you run this you will simply get an error and that is a you problem, not a me problem. πŸ’€

🌸 DESCRIPTION 🌸

so, Text::CHM is a module that implements a (partial) support for handling MS Compiled HtmlHelp Files (chm files for short) via CHMLib. CHMLib is a small library designed for accessing MS ITSS files. the ITSS file format is used for chm files, which have been the predominant medium for software documentation from Microsoft. no cap, that's just history. πŸ“š

chm is a filesystem based file format, such as MS Excel or MS Word file formats β€” but they aren't the same. like, same family reunion, different tables. πŸ™ˆ

what can you actually do with it? Text::CHM lets you open chm files, get their filelist, get the content of each file and close them. and that's it. at the moment, no write support is available. so no, you cannot edit the chm. it's read-only, it's giving ✨look but don't touch✨. periodt. πŸ’…


πŸŽ€ METHODS πŸŽ€

new(filename)

opens the chm file filename and returns the chm object. that's your main character entrance right there. πŸ¦‹

filename()

returns the name of the current working chm file. a little "who am I" moment. 🌈

get_filelist()

returns a list of hash references with the following fields:

  • path: the path of the file in the chm object;
  • size: the size of the file;
  • title: the title of the file, if it is an html one, else undef.
note that title is undef when it's not an html file, so vibe check your data before you use it. 🧚

get_object(path)

returns the content of the object found at path in the chm file. this is the one that actually hands you the goods. πŸ”₯

close()

close the chm file opened with new(). say goodbye, be polite, free your resources. πŸŽ€


πŸ‘€ SEE ALSO πŸ‘€

general understanding of perl is required, see "perldoc perl" for more informations.

the CHMLib website is available (at the moment) at the address http://66.93.236.84/~jedwin/projects/chmlib/.

for a detailed (unofficial) description of the CHM file format see Pabs' unofficial chm specifications or Matthew T. Russotto's CHM site, respectively at http://savannah.nongnu.org/projects/chmspec and http://www.speakeasy.org/~russotto/chm/.

Text::CHM's website is http://digilander.libero.it/bash/text-chm/.


πŸ’œ AUTHOR πŸ’œ

Domenico Delle Side, <dds@gnulinux.it>


Copyright (C) 2005 by Domenico Delle Side

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.


okay that's the whole page, bestie!! πŸ₯³ this was documented with perl v5.42.0 and dated 2025-07-25 β€” so like, a lil vintage but still serving. go read some chm files, you absolute legend. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from