Variables used in a procedure have local scope unless explicitly
declared global:
% set v 100
100
% proc p {} {
puts $v
}
% p
can't read "v": no such variable
% proc p {} {
global v
puts $v
}
% p
100
More insane scoping facilities are provided with upvar and uplevel. Avoid them if at all possible.
nix@cs.cmu.edu