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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.