From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/7777 Path: main.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: [release] Kpse-0.01: Kpathsea perl interface module, alpha version Date: Fri, 26 Apr 2002 17:25:08 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <20020426172508.7545648e.taco@elvenkind.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035398223 22269 80.91.224.250 (23 Oct 2002 18:37:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:37:03 +0000 (UTC) Original-To: ntg-context@ntg.nl, tex-nl@nic.surfnet.nl Xref: main.gmane.org gmane.comp.tex.context:7777 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:7777 Hi all, I just uploaded an alpha version of a new utility I am working on: ---------------------- NAME Kpse - Perl extension for the Kpathsea search library SYNOPSIS use Kpse; Kpse::initialize(); $a = Kpse::lookup("tex","plain.tex"); # hardwired format print Kpse::lookup("","cmr10.tfm"); # let Kpse guess format from ext. print Kpse::lookup("tex","plain.tex",1); # must exist @a = Kpse::lookup("tex","plain.tex"); # find all files ABSTRACT This package provides a perl interface to the Kpathsea library. Most of the user-level functions are designed to mimic kpsewhich behaviour, but low-level libarary inter­ face functions are also available. ----------------- You can get the source tar and a demonstration program from: http://www.chatalicious.nl/~taco/Kpse/Kpse-0.01.tar.gz http://www.chatalicious.nl/~taco/Kpse/kpsewhich.pl Build instructions (as usual for a perl extension library): tar xzf Kpse-0.01.tar.gz cd Kpse-0.01 perl Makefile.PL make make install (you may have to be root for this) Source builds OK on my linux (mandrake 8.2), but that's the only system I know anything about at the moment (I am definately interested in build reports!). You are warned that the code is ALPHA level and the documentation nearly non-existent. "perldoc Kpse" should give you the call interface for the subroutines that are available, but it doesn't explain much about usage (yet). Kpse.pm seems to function ok, but there are probably still a number of bugs and/or omissions. kpsewhich.pl is a demonstration program, it functions exactly like the "stock" kpsewhich executable, except for the following: - Debug output is always printed *after* the actual command, and on stdout instead of stderr. (because the library writes to a perl array, not to stderr). - the (undocumented) kpsewhich switch --all actually works. - startup is somewhat slower (due to perl loading & compilation time) kpsewhich.pl becomes faster than system("kpsewhich @ARGV") after about four lookups, so it is an interesting module if you need to test for the existence of e.g. macro packages or font files from within a perl script (that's where the idea came from in the first place). Bug reports, feature requests, comments, etc. are all welcome. Have fun! Taco Hoekwater taco@elvenkind.com