in reply to Re: CGI Tables, yippie!!
in thread CGI Tables, yippie!!

Ok, I added the commas and the errors nearly disappeared! Thanks so much! But I have another problem though and since I'm really new to using CGI I don't exactly know how to debug things like this myself.

The error I get this time is "Thu Apr 3 07:11:31 2003 tags.pl: syntax error at tags.pl line 39, near ");" ", any suggestions?

It's kinda funny how it's Tr and td, but whatever works :)

print start_form(), table( Tr(Td( "Email Address: "), Td(textfield('usermail')), Tr(Td("Author: "), Td(textfield('author')), Tr(Td("Distributor: "), Td(textfield('distributor')), Tr(Td("Copyright: "), Td(textfield('copyright')), Tr(Td("Abstract: "), Td(textfield('abstract')), Tr(Td("Keywords: "), Td(textarea(-name=>'keywords', -rows=>10, -columns=>50)), Tr(Td("Description: "), Td(textarea(-name=>'description', -rows=>10, -columns=>50))), Tr(Td("Robots: "), Td(popup_menu(-name=>'robots', -values=>['','index','noindex','follow','nofollow']))), Tr(Td("Distribution: "), Td(popup_menu(-name=>'distribution', -values=>['','local','global']))), Tr(Td("Language: "), Td(popup_menu(-name=>'language', -values=>['','EN','EN-GB','EN-US','ES','ES-ES','FR','IT +','JA','KO','DE']))), Tr(Td("Rating: "), Td(popup_menu(-name=>'rating', -values=>['','kids','general','mature','restricted']))) +, Tr(Td(), Td(submit)), end_form(), ), hr(); #### this is line 39


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Replies are listed 'Best First'.
Re: Re: Re: CGI Tables, yippie!!
by Jost (Novice) on Apr 03, 2003 at 13:55 UTC
    Your first textarea is missing a ')' at the end.
    If you happen to use vim (or vi), the way to find such a thing is to put the cursor on the first (or last) '(' (or '{' or whatever) character and hit on '%'.
    In most cases this will jump to a place where the error is close.
Re (3): CGI Tables, yippie!!
by VSarkiss (Monsignor) on Apr 03, 2003 at 15:20 UTC

    syntax error at tags.pl line 39, near ");" ", any suggestions?
    Your parentheses are unbalanced. On at least the first two "Tr" lines, you're opening more than you're closing.

    If your HTML is getting this complex, it might be time to look at HTML::Template or something similar.

Re: Re: Re: CGI Tables, yippie!!
by benn (Vicar) on Apr 03, 2003 at 13:33 UTC
    That's the one pita with CGI.pm tables - I love them, but you've got to keep bouncing on the "match bracket" key. It looks like this might be to do with a mis-matched bracket somewhere (but I don't see ');" "' on line 39 - puzzling)

    A minor point though (from a coding point of view, but important where your HTML validation is concerned) - you appear to have your 'start_form()' outside the table, while the 'end_form()' is inside it. Best to stick the end_form() outside too, so validators don't complain about your nesting.
    Cheers,
    Ben
Re: Re: Re: CGI Tables, yippie!!
by Anonymous Monk on Apr 04, 2003 at 12:33 UTC
    That's the reason why I always use print "<TR><TD>Blah blah blah</TD></TR>"; just because I know it works... :) (Yes, I know conceptually it's beautifull to reuse the tr & td code, but sometimes I feel that reinventing the wheel works best...)