Best online Tcl refresher/tutorial

18 views
Skip to first unread message

George M Jempty

unread,
Oct 17, 2002, 4:28:21 PM10/17/02
to
I haven't programmed any Tcl since last summer (some of you may
remember me), and only then for a few weeks, though I got good enough
to have a recipe approved on activestate.com. Not boasting, just
trying to give information about my proficiency.

Per "The Pragmattic Programmer", I'm taking up a scripting language in
addition to our enterprise language, Java. My only book is "CGI
Programming with Tcl", which doesn't cut it; I may buy the new one
coming out from Kevin Kenny.

Until then, what's the best online refresher/tutorial for Tcl? In
particular I will be working with files, scanning lines for text
patterns, replacing and overwriting.

Thanks in advance.

George "Poyl Schmoyl" Jempty


Cameron Laird

unread,
Oct 17, 2002, 4:43:13 PM10/17/02
to
In article <uqu7i46...@corp.supernews.com>,
George M Jempty <George...@Buckle.com> wrote:
.
.

.
>Per "The Pragmattic Programmer", I'm taking up a scripting language in
>addition to our enterprise language, Java. My only book is "CGI
>Programming with Tcl", which doesn't cut it; I may buy the new one
>coming out from Kevin Kenny.
>
>Until then, what's the best online refresher/tutorial for Tcl? In
>particular I will be working with files, scanning lines for text
>patterns, replacing and overwriting.
.
.
.
Kevin, is your book really on schedule for appearance?
'Last I heard, it was permanently postponed.

Anyway, the Wiki has plenty for you to read. Start with
<URL: http://wiki.tcl.tk/tutorial > and
<URL: http://wiki.tcl.tk/1041! >.
--

Cameron Laird <Cam...@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://phaseit.net/claird/home.html

Glenn Halstead

unread,
Oct 17, 2002, 5:04:15 PM10/17/02
to
If you're buying a book then the Brent Welch one is very good.

Glenn


"George M Jempty" <George...@Buckle.com> wrote in message
news:uqu7i46...@corp.supernews.com...

Glenn Jackman

unread,
Oct 17, 2002, 5:11:59 PM10/17/02
to
George M Jempty <George...@Buckle.com> wrote:
> Until then, what's the best online refresher/tutorial for Tcl? In
> particular I will be working with files, scanning lines for text
> patterns, replacing and overwriting.

If you're looking to refresh your memory about certain commands, head
for the man pages: http://www.tcl.tk/man/

For what you mention, see the commands: open, close, read, gets, puts,
file, string, regexp, regsub, re_syntax, ...

--
Glenn Jackman
gle...@ncf.ca

George M Jempty

unread,
Oct 17, 2002, 6:08:55 PM10/17/02
to
Thanks everyone! I've used Brent's book in the past and also interacted
with him a bit last summer on the tclhttpd list; amazon.com indicates there
may be a 4th edition on the horizon.

As it turns out, "CGI Programming with Tcl" actually did turn out to have a
very useful example for me on pp. 95-96

George "Poyl Schmoyl" Jempty


Donal K. Fellows

unread,
Oct 18, 2002, 9:40:24 AM10/18/02
to
George M Jempty wrote:
> Per "The Pragmattic Programmer", I'm taking up a scripting language in
> addition to our enterprise language, Java.
[...]

> Until then, what's the best online refresher/tutorial for Tcl? In
> particular I will be working with files, scanning lines for text
> patterns, replacing and overwriting.

OK, so you're doing bread-and-butter stuff for scripting languages. Any of the
mainstream ones (Tcl, Perl, Python, etc.) can do this handily. However, if we
look towards where next, we can see that several languages can interwork with
Java very nicely, and Tcl is one of them (via Jacl and TclBlend, which go about
the task in slightly different ways that I won't discuss in this message.)

In my experience, scripting languages are at their best when you're using them
to connect up components written in some other language (e.g. Tk and Expect, or
Metakit and TclVFS). I'd say that there's only really one massive argument in
favour of you going with Tcl, and that is that you already know the basics.
Which is really a reasonable argument when you get right down to it.

When brushing up on your skills, try looking through the Wiki at
http://wiki.tcl.tk/ or even just sit down with a wish session and try to do
something interesting. "Learning by doing" is my favourite technique; books
just serve to alert me to other ways of doing...

Donal.
--
"Windows is a car with square wheels (architecture) and a huge engine (hype,
etc.), capable of of making the car move despite the square wheels. Linux
is a car with round wheels but a small engine, capable of making the car go
despite the small engine." -- John Latham <j...@cs.man.ac.uk>

Neil Madden

unread,
Oct 18, 2002, 10:26:23 AM10/18/02
to
Cameron Laird wrote:
>
> In article <uqu7i46...@corp.supernews.com>,
> George M Jempty <George...@Buckle.com> wrote:
> .
> >Per "The Pragmattic Programmer", I'm taking up a scripting language in
> >addition to our enterprise language, Java. My only book is "CGI
> >Programming with Tcl", which doesn't cut it; I may buy the new one
> >coming out from Kevin Kenny.
> .
> .
> Kevin, is your book really on schedule for appearance?
> 'Last I heard, it was permanently postponed.
>

Kevin possibly has a book coming out? What area is it in? I'd love a book with
really up to date and in depth information on building C extensions for Tcl.
Especially something which covered TEA2. My dabbling with the C interface of Tcl
has only really scratched the surface.


Neil
--
package r Tkhtml;package r http;pack [scrollbar .v -o v -co {.h yv}] -s right\
-f y;pack [html .h -ys {.v set}] -f both -e 1;bind .h.x <1> {eval g [.h href %x\
%y]};proc g u {set t [http::geturl $u];.h cl;.h p [http::data $t];http::cleanup\
$t;.h co -base $u};g http://mini.net/tcl/976.html;proc bgerror args {};# NEM :-)

George M Jempty

unread,
Oct 18, 2002, 10:57:01 AM10/18/02
to
"Donal K. Fellows" <donal.k...@man.ac.uk> wrote in message
news:3DB00F48...@man.ac.uk...

> I'd say that there's only really one massive argument in
> favour of you going with Tcl, and that is that you already know the
basics.
> Which is really a reasonable argument when you get right down to it.
> [...]

Quite right, plus I can eventually write WinCVS macros using Tcl :)

George "Poyl Schmoyl" Jempty


lvi...@yahoo.com

unread,
Oct 18, 2002, 11:57:41 AM10/18/02
to

According to George M Jempty <George...@Buckle.com>:
: My only book is "CGI

:Programming with Tcl", which doesn't cut it;

Are you wanting to learn Tcl, to learn to do CGI with Tcl, or both?
I've heard lots of good things about the following books:

Database Backed Web Sites

and I even own these ones:

CGI Developer's Resource: Web Programming in Tcl and Perl
Web TCL Complete
Practical Programming in Tcl and Tk, Third edition (a new edition of
this is hopefully forthcoming now that Tcl/Tk 8.4.x is out)

:Until then, what's the best online refresher/tutorial for Tcl? In


:particular I will be working with files, scanning lines for text
:patterns, replacing and overwriting.

<URL: http://wiki.tcl.tk/ > , <URL: http://www.tcl.tk/ > and
<URL: http://aspn.activestate.com/ASPN/Tcl/ > are the 3 best
online references I know.


--
Tcl - The glue of a new generation. <URL: http://wiki.tcl.tk/ >
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvi...@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >

George M Jempty

unread,
Oct 18, 2002, 4:59:28 PM10/18/02
to
<lvi...@yahoo.com> wrote in message news:aopb1l$e73$1...@srv38.cas.org...

>
> According to George M Jempty <George...@Buckle.com>:
> : My only book is "CGI
> :Programming with Tcl", which doesn't cut it;
>
> Are you wanting to learn Tcl, to learn to do CGI with Tcl, or both?

Please let me clarify. The "CGI Programming with Tcl" book is the only one
I presently own. I wasn't confident that it would meet my needs as a
refresher for Tcl. I was mistaken. There is an excellent file browsing
example, plus a Tcl "primer" as an appendix. So on second thought it might
just tide me over until a new Tcl book is published, such as the Welch's 4th
edition as indicated on amazon.com, comes out.

By the way, I've always thought "CGI Programming with Tcl" to be a fine
book. In particular the first chapter "The Internet" is a fantastic
introduction to TCP/IP, including an explanation of the 3-way handshake.

George "Poyl Schmoyl" Jempty


Donal K. Fellows

unread,
Oct 21, 2002, 5:08:03 AM10/21/02
to
George M Jempty wrote:
> Quite right, plus I can eventually write WinCVS macros using Tcl :)

I prefer tkcvs (and tkdiff) for that. Easier (well, easier than with the
version of WinCVS I've got at home) to study diffs between two versions in the
tree...

Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ donal....@man.ac.uk
-- Naturally I will not be justifying this traditional argument with evidence
and rationale. -- Richard Thrippleton <re...@cam.ac.uk>

Reply all
Reply to author
Forward
0 new messages