in reply to creating an error message

This is bringing back an internal software error. Can anybody see why this is happening?
I'm assuming you mean "internal server error" - go look in the logs.

As mentioned null isn't a perl keyword, so this will only work if you have a null() function defined. Also, you probably want to use defined instead.