Somebody's going to say this, and I may say it more tactfully than some others: may I encourage you to
use strict and warnings. There are so many reasons why this is a good thing. I used to poo-poo them all but over time my code got claggier and slower and in the end when I made the effort, there was hardly any pain and a sudden improvement in programming style and reliability.
One other advantage: it would probably
make your question easier to answer. As it stands you've posted a longish piece of code, and it's not a costless endeavour to go through it and work out where it breaks. But if you ran it under
strict with warnings enabled, then when it broke you could look at your server error log and it wd likely give you a handy line-referenced message telling you where the problem was. Or if you don't have access to the error log and you can put the following at the top of your code:
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
use CGI qw(:standard);
print header;
warningsToBrowser(1);
Then it sends the error messages to your browser (warnings will show up as HTML comments).
And... then you'll be running CGI.pm which you can use to make yourself MUCH HAPPIER. It really does make sense - I speak as someone who's tried both ways. If you're unconvinced -
use CGI or die;!
At the end of that, if you still can't figure out the problem with all the help that
strict and its pals are giving you, then post again and you'll get a complete answer.
§
George Sherston
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.