in reply to Add Null values to my FlatFile

You might show what the contents of %FORM (and the output to LOGFILE) look like.

Failing that, I'd suggest you  print LOGFILE "/$key/".$FORM{$key}."\n"; instead of your current print, to see what is going on.

Replies are listed 'Best First'.
Re^2: Add Null values to my FlatFile
by lakeTrout (Scribe) on Nov 26, 2007 at 21:34 UTC
    Hi, thanks for taking a look. The log file prints everything in sequence, something like this:
    Head1 Head2 Head3 Head4 Head5 val1 val2 val9 val10 val1
    what I want is this:
    Head1 Head2 Head3 Head4 Head5 ... Head9 val1 val2 val9
    where values 3-8 are null, they don't print. I'll try you suggestion and see what that gives me.

    Thank you!

    UPDATE:
    adding: print LOGFILE "/$key/".$FORM{$key}."\n"; instead of what I have already doesn't add the fields with no value, it just prints element on a new line, like it's a new record in the flat file
      I was vague; my apologies. I suggested the new print as a debugging aid. It wasn't intended as a solution to the problem.

      Having seen the follow-up, I'd agree with aquarium; if the value is NULL, force it to a blank or a fixed string.