in reply to testing for the zero length string (blank value) in cgi fields

I think you may have a problem with your quotes. The line
if (param('$neg') eq "") {
will not interpolate the value of $neg, so unless you have a parameter called '$neg' (with the dollar symbol) then this will always evaluate to true, hence trashing the values of your other parameters.

Try it like this instead:

if (param($neg) eq "") {
Cheers,

JJ

Update: Must learn to type as quickly as Masem :-)