in reply to perl cgi-bin script

I don't see where $unique is declared and defined. I have to assume it's part of one of the required files, and appears to behave as a safeguard against multiple entities of the script trying to write to the same files at the same time (otherwise known as a race condition, usually leading to file corruption).

However, if you're not declaring and defining $unique in the .conf files, you're outta luck; the outfile never gets opened. That's one place to check.

If that turns out to not be the problem, you need to get a little more clever about your approach.

What happens if you run the script from the command line? Does it then work ok? If so, it's possible that you've got an issue where your outfile's permissions are set such that the script, when run as "nobody" (common for web applications), doesn't have permission to write to or create the outfile. That's a common pitfall.

Another thing to try is to put a print here and there throughout the script that will output to the browser (or to a logfile if you wish) a sort of progress report, letting you know, this section executed, that section executed, etc. By carefully placing the prints, you can determine whether or not files have opened, etc.

And for heaven's sake, consider using strict, warnings, taint mode, and CGI.pm for future CGI scripts.


Dave


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein