if ( defined($foo) and $foo eq '?' ) { print "\$foo OK!\n"; }