You have to consider who is reading that line and acting upon it. The answer is: the kernel. And it's not emulating a shell or a program like perl. So it isn't looking for names of environment variables.
So, you're barking up the wrong tree using this syntax. (But see the thread for alternative answers).