Chapter 5

Using Strings and Lists

This chapter describes how to use Tcl strings and lists for common data-searching applications. A common programming task is extracting one piece of information from a large mass of data. This section discusses several methods for doing that and introduces a few more Tcl concepts and commands along the way.

For the application, we will find the Noumena Corporation home page in a list of uniform resource locators (URLs) for some Tcl information and archive sites. The following is the starting data, extracted and modified from a browser’s bookmark file.

% set urls {

wiki.tcl.tk "Tcler’s Wiki"

core.tcl.tk "Tcl/Tk Fossil Core"

sourceforge.net/projects/tcl/ "Sourceforge Tcl"

sourceforge.net/projects/tktoolkit/ "Sourceforge ...

Get Tcl/Tk, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.