http://www.bludgeon.org/~rayvd/eggdrop/rand_quote.tcl
The script works great... except that the close function in TCL doesn't appear to actually close the file descriptor opened by "open". After a lot of people use the !quote feature, too many file descriptors will be open, and the bot will basically hang. An examination of eggdrop.log shows that the bot is unable to do much of anything because all file handles are in use. I have verified that the script opens hundreds of file handles (using the Linux 'lsof' command) and the only time at which they are closed is when the parent tcl script is ended (eggdrop).
Has anyone run into this before? Is there any work-around, or a way to close file handles without exiting the parent process? The only semi-solution I can think of is to write the program in an external script and call it from the TCL. But darnit, I already wrote it all in TCL, why doesn't close just work like it does in every other language??

Ok, thanks!