Version 11 of TCLLIBPATH

Updated 2004-11-08 09:39:57

Purpose: to document the use of another of the magic names in Tcl. More formally, TCLLIBPATH is an environment variable; inside Tcl you can retrieve it with $::env(TCLLIBPATH).

What is its purpose?

To provide user specified locations to add to the package search path.

What is its format?

A tcl list of directory paths (unix-style paths for Win32 users). e.g: set TCLLIBPATH="/opt/tcl/site-lib /users/pat/working"

What are some good reasons to set it?

PT 20-Jul-2004: I like to keep all my local packages separate from the ActiveTcl installation that I use as a base. So I install all additional packages to a site-lib directory and then set TCLLIBPATH to this directory path. With this in place a [package require XYZ] command will search ActiveTcl and my site-lib directory for the most recent version of XYZ.

* test a package without installing.

What else?

D. McC 08-Nov-2004: Well ... what about this?

david@localhost david% puts $::env(HOME) /home/david david@localhost david% puts $::env(TCLLIBPATH) can't read "::env(TCLLIBPATH)": no such variable

This happens on my Mandrakelinux 10.0 system, running Tcl 8.4 from the tcl-8.4.5-3mdk RPM package. Why no TCLLIBPATH, I wonder?


See also TCL_LIBRARY

[ Category Tutorial ]