
unset env, array set env ...
There is a very weird problem when I try to unset env, then array set env--
after doing so, it seems that tcl treats the env array and the actual
environment variable differently. The behavior is not what one would expect:
set array_list [array get env]
unset env
array set env $array_list
set env(01aaa) HEY
# Find out the actual environment variable using /bin/env
foreach a [lsort [exec /bin/env]] {regexp -- {(.+)=} $a _ a; lappend tmp $a}
puts "env ENV: $tmp"
# Find out tcl's own env array
puts ""
puts "tcl ENV: [lsort [array names env]]"
Is this "out-of-sync" behavior a desirable one?
Kevin