Note that defined foo tests whether the variable foo is defined, whereas defined $bar tests whether the variable whose name is stored in $bar is defined.
defined foo
defined $bar