in reply to Perl DBI NULL and undef

You are missing an 'else statement corresponding to your
if (defined($_))
Also, your statement
elsif (undef($_))
probably does not do what you think it does. Please read the documentation for what that function returns. It also effects the value of $_, which is probably undesirable.

instead of that, just replace that line by

else

             I hope life isn't a big joke, because I don't get it.
                   -SNL