in reply to Beginner needs help with very simple issue

I'm not sure exactly what you're asking for--first off, you're using the wrong comparison operator. You should be using "eq", because you're testing string equality:
if ($query->param($key) eq "") {....}
But are you asking how to tell if the paramater has been set or not? If so, use defined:
if (defined $query->param($key)) {....}