When you are learning a new language, it always takes much longer to
solve problems. And in your case I'm afraid, you aren't taking much time
to actually learn the language which is compounding the problem.
The answer to your current problem is well documented in the exec man
page, and on the exec pages on the tcler's wiki. The problem you are
encountering is very simple: you are telling it to execute "php" but tcl
can't find "php". The short answer is, you either have to explicitly
tell the exec command which *file* to execute (eg: exec
/usr/local/bin/php), or you have to make sure that the file you tell it
exists somewhere within a directory defined in your PATH environment
Phil, I'm sorry you're having so many problems. You are correct that
this probably should have taken only an hour or two for a seasoned
programmer, but you are not a seasoned programmer and properly parsing
XML is, generally speaking, a Hard Problem. At least, it's hard when you
choose to not use proper XML parsing solutions and instead rely on a
series of text transformations.
Tcl is a very powerful language, but it doesn't have built-in facilities
to parse XML. This is not a weakness of Tcl, it's just the way it is.
The beauty of Tcl is, people can write extensions to the language to do
just about anything, including parsing XML. Unfortunately, you are
choosing not to take the time to learn how to use them.
I'll again recommend trying the xml2list function documented here:
'm guessing that will work good enough for
you. Fortunately, it appears you're working on a simply hobby
application rather than a commercial application so we don't have to
worry so much about robustness.