That's gives me all the keys (50) and I have only filled in three stories. I would expect to get 30 in that case but something isn't quite right at 'if (defined($r->param...' because both keys and vaules return 50 which is the total number of possible fields and not simply the ones with a values.
Try removing the call to defined() and just testing to see if the value is true. Or perhaps check for some length(). I suspect you are getting empty strings ( '' ), which are, of course, defined().
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>