Do you understand why this is so? It's an important lesson to learn
The explanation is pretty simple: tcl expands all variables before
calling the command. So, y$x is expanded, and _then_ passed to the
global command. At the point in time that y$x is expanded, x is undefined.