My build script starts with set top cpu_core and later defines proc report_top {} { puts "Top module: $top" }. Calling the procedure fails with can't read "top": no such variable. A second procedure that does set error_count 1 runs without complaint but the script-level error_count stays at 0. I also could not pass an array to a procedure as an argument.
How does variable scope work in Tcl procedures?




