カレッヂ |
質問者 profu
投稿日 2006/9/4(月) 05:47:34
[削除] (返信・回答が付いた後にこの質問の削除はできません)
perlはかけませんが、cgiでBBSやUPloaderなどをかきかえたことはあります。 サーバーの検索にと思い、改造を始めました。 下の状態できちんとperlのパス、パーミッションも設定し、アップしたところ 「HTTP 500 - 内部サーバー エラー」と表示され問題があるため表示できないと 書かれています。サンプルはきちんと動きました。 Perlの文法チェックツールで、チェックしたところ 76に構文エラーと出ました。 URL http://web.chobi.net/~profu/cgi-bin/ ------------------------------------------------------------------------------------ syntax error (F) おそらく、構文エラーが起こっています。よくある原因としては、 キーワードのスペルミス。 セミコロンを忘れた。 コンマを忘れた。 開き括弧、閉じ括弧を忘れた。 開き中括弧、閉じ中括弧を忘れた。 クォートの閉じ忘れ。 が考えられます。 ---------------------------------------------------------------------------------- Perlのエラー出力 syntax error at tmp.pl line 76, near "; =" Missing right bracket at tmp.pl line 195, at end of line tmp.pl had compilation errors. ソース 0001: #!/usr/local/bin/perl ---------中略---------- 0060: #■検索処理 0061: 0062: if (!open(IN,"$file")) { &error('データベース読取エラー','復旧をお待ちください.'); } 0063: @BASE = <IN>; 0064: close(IN); 0065: 0066: if ($FORM{'FF'} eq '') { $FF = 0; } else { $FF = $FORM{'FF'}; } 0067: $TO = $FF + $page - 1; 0068: if ($TO > $#BASE) { $TO = $#BASE; } 0069: $hit = 0; 0070: $next_num = ''; 0071: 0072: foreach $num ($FF .. $#BASE) { 0073: 0074: $data = $data2 = $BASE[$num]; 0075: &jcode'convert(*data,'euc'); 0076: ($d,$DATE,$NAME,$SIZE,$FTP,$OFFICE,$KOUKOKU,$CGI) = split(/\,/,$data); = split(/\,/,$data); 0077: 0078: # 容量 0079: 0080: if ($FORM{'SIZE'} ne 'all') { 0081: 0082: if ($SIZE eq $FORM{'SIZE'}) { ; } else { next; } 0083: } 0084: 0085: # 申込の種類 ---------中略---------- 0113: # CGI 0114: 0115: if ($FORM{'CGI'} ne 'all') { 0116: 0117: if ($CGI eq $FORM{'CGI'}) { ; } else { next; } 0118: } 0119: 0120: # 検索終了処理 0121: if ($hit == $page) { $next_num = $num; last; } 0122: else { push(@NEW,$data2); $hit++; } 0123: 0124: #■検索結果 0125: 0126: print "Content-type: text/html\n\n"; 0127: print <<"EOF"; 0128: <html><head><title>$title</title></head> 0129: <!-- MiniDatabase v2.1 (c) www.rescue.ne.jp --> 0130: $body 0131: <h2>《検索結果》</h2> 0132: EOF 0133: 0134: if (!@NEW) { print "●ご指定の条件では見当たりませんでした.<p>\n"; } 0135: else { 0136: print "<table border=2 cellpadding=1 cellspacing=1><tr>\n"; 0137: 0138: print "<th nowrap>更新日</th>\n"; 0139: print "<th nowrap>無料サーバー</th>\n"; 0140: print "<th nowrap>容量</th>\n"; 0141: print "<th nowrap>申込の種類</th>\n"; 0142: print "<th nowrap>FTP</th>\n"; 0143: print "<th nowrap>商用</th>\n"; 0144: print "<th nowrap>広告</th>\n"; 0145: print "<th nowrap>CGI</th>\n"; 0146: 0147: print "</tr>\n"; 0148: 0149: foreach $data (@NEW) { 0150: 0151: ($d,$DATE,$NAME,$SIZE,$FTP,$OFFICE,$KOUKOKU,$CGI) = split(/\,/,$data); 0152: 0153: print "<tr>\n"; 0154: 0155: print "<td nowrap>$DATE</td>\n"; 0156: print "<td nowrap>$NAME</td>\n"; 0157: print "<td nowrap><center>$SIZE</center></td>\n";; 0158: print "<td nowrap><center>$MOUSHIKOMI</center></td>\n"; 0159: print "<td nowrap><center>$FTP</center></td>\n"; 0160: print "<td nowrap><center>$OFFICE</center></td>\n"; 0161: print "<td nowrap><center>$KOUKOKU</center></td>\n"; 0162: print "<td nowrap><center>$CGI</center></td>\n"; 0163: 0164: print "</tr>\n"; 0165: } 0189: print "$body\n"; 0190: print "<h1>$_[0]</h1>\n"; 0191: print "<h3>$_[1]</h3><p>\n"; 0192: print "ブラウザの[戻る]ボタンを押して前の画面に移動してください.<p>\n"; 0193: print "</body></html>\n"; 0194: exit; 0195: }
【プロバイダ】http://chobi.net/index.html |
返信(回答)する
Web裏技 |