Yes. More code and a better error description are needed. I thought I had found something in the use of $FORM. Apparently this needs to stay in the code, but we have no idea how that hash is being populated. If you're getting nothing out of the statement
$FORM{$qid}, then the cause may be in the %FORM hash, or may be something as simple as what
tye suggested - having newline characters hanging off the end of
$qid.
GuildensternNegaterd character class uber alles!