Below is my entire chat script to date and I know how many of you truly love giving your thoughts on other ways to do it and so forth but as for right now I think the script is moving along ok the way it is. This was posted in the CB earlier (part of it) and the problem was somewhere between using commas at the end of the lines and using semi colons.

Problem might be I've never been sure where to use commas instead of semi colons so I've only used commas for tables and forms and colons for everything else. I was wondering if someone could throw this in their debugger and give me pointers on what's wrong.

I get:

syntax error at chat.pl line 93, near "if" syntax error at chat.pl line 111, near "}" Execution of chat.pl aborted due to compilation errors.
Thanks for your time everyone.
#!/usr/bin/perl -w open( STDERR, ">>/home/sulfericacid/public_html/error.log" ) or die "Cannot open error log, weird...an error opening an error log +: $!"; use strict; use warnings; use POSIX; use CGI qw(:standard start_table end_table); use lib ""; #use Tie::IxHash; require SDBM_File; my %chat; my %chatorder; my $chat = "list.dbm"; #my $file = "iplog.txt"; tie %chat, "Tie::IxHash"; tie %chatorder, "Tie::IxHash"; tie %chat, 'SDBM_File', $chat, O_CREAT | O_RDWR, 0644; if ( !tied %chat ) { print "database unsuccessful $!.\n"; } print header, start_html; # # Time to keep accurate logs # my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); print "the local time is $hour:$min:$sec"; print start_table; print Tr(td({-height=>'5', width=>'700', bgcolor=>'#BBCCEE'},"<font si +ze=2><b>ChatterBox version 1.0</b></font>" )); print Tr(td({-height=>'5', width=>'700', bgcolor=>'#BBCCEE'},"")); my $add; foreach (reverse keys (%chat)) { $add++; if ($add <= 10) { $chatorder{$_} = $chat{$_}; } } foreach (reverse keys (%chatorder)) { my ( $name, $message, $time ) = split /::/, $chatorder{$_}; print Tr(td({-width=>'700'},"<font color=blue>$name @ $time:</font +> $message")), } print Tr(td({-height=>'5', width=>'700', bgcolor=>'#BBCCEE'},"")); print Tr(td({-height=>'5', width=>'700', bgcolor=>'#BBCCEE'},"<font si +ze=2 palign=right><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb +sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb +sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp +;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n +bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp +;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n +bsp;&nbsp;&nbsp;&nbsp;http://sulfericacid.perlmonk.org</b></font>" )) +; print start_form(), table( Tr( td("Name: "), td( textfield( -name => 'name', -size => 40 ) ) ), Tr( td("Message: "), td( textfield( -name => 'message', -size => 100 ) ) ), qq(<SCRIPT LANGUAGE="JavaScript">), Tr( td(), td(submit), td("document.write('<form><input type=button value=\"Refresh\" onC +lick=\"history.go()\"></form>)" ), ), end_form(), hr(), qq(</script>), qq(<a href="log.pl" target="new">chat logs</a>), if ( param() ) { my $name = param('name'); my $message = param('message'); my $cnt; open( LOG, "$file" ); $cnt = <LOG>; close(LOG); $cnt++; open( LOG, "> $file" ); print LOG $cnt; close(LOG); my $keeptime = join (':', $hour, $min, $sec); my $info = join ( '::', $name, $message, $keeptime ); $chat{$cnt} = $info; }


"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

In reply to Syntax errors galore, need a good debugging by sulfericacid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.