Re: Optimizing TCL Code



On 5 Nov., 10:50, "Donal K. Fellows" <donal.k.fell...@xxxxxxxxx>
wrote:
If the file is "large" (where that term is something that is
highly dependent on the data) then you might be better off using a
while loop with [gets]. (If you do that, remember to put the [eof]
test *after* the [gets]!)

The usual idiom is:

set f [open $filename]
while {[gets $f line] >= 0} { #-- this is the test for EOF
do something with $line
}
close $f
.