in reply to Warning for checking with undef

Check out function defined(). Example.
if (!defined($foo)) { }