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:
Thanks for your time everyone.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.
#!/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> + &nb +sp; + &nb +sp;   +; &n +bsp;   +; &n +bsp; 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; }
In reply to Syntax errors galore, need a good debugging by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |