Posted to tcl by rmax at Fri Nov 28 11:02:18 GMT 2014view raw

  1. set script ""
  2. append script "proc manyifs {} {"
  3.  
  4. # The global state variables that are needed by the ifs.
  5. append script "global foo bar baz"
  6.  
  7. foreach file $files {
  8. set fd [open $file]
  9. append script [gets $file] "\n"
  10. close $fd
  11. }
  12.  
  13. append script "}"
  14. eval $script
  15. manyifs