prevnext "Global Data
" ?>
In order to access global data, we again utilize Tcl's namespace
hierarchy:
namespace eval request {
set ::global_data [clock seconds]
}
namespace delete request
namespace eval request {
puts "The last person to access this child process came at:"
puts [clock format $::global_data]
}
namespace delete request
As we can see, the first request sets a variable in the global
namespace, where it won't be destroyed when the 'request'
namespace is deleted. This makes it accessible to other scripts.