3 $ERROR_LINE_SYNTAX = 1;
4 $ERROR_STROKE_SYNTAX = 2;
8 binmode STDOUT, ":utf8";
13 my $data = $form->param('partsdata');
15 $data =~ s/\&/\&\;/g;
16 $data =~ s/</\<\;/g;
17 $data =~ s/>/\>\;/g;
18 $data =~ s/\"/\"\;/g;
19 @buffer = split(/\r\n|\r|\n/, $data);
27 foreach $temp (@buffer){
28 if($temp =~ m/:/ && $temp =~ m/[0-9]/){
29 @temp = split(/ |\t|\r\n|\r|\n/, $temp);
34 foreach $temp (@buffer){
35 if($temp =~ m/:/ && $temp =~ m/[0-9]/){
38 @temp = split(/ +|\t|\r\n|\r|\n/, $temp);
39 if(scalar(@temp) != 2){
40 $error = $error | $ERROR_LINE_SYNTAX;
42 @temp2 = split(/\$/, $temp[1]);
43 foreach $temp2 (@temp2){
46 if($temp2 =~ m/^1:(0|2):(0|2):/){ $check++; }
47 if($temp2 =~ m/^1:(0|12|22|32):(0|13|23|32|4):/){ $check++; }
48 if($temp2 =~ m/^2:(0|12|22|32):(4|5|7):/){ $check++; }
49 if($temp2 =~ m/^2:7:(0|4|8):/){ $check++; }
50 if($temp2 =~ m/^2:2:7:/){ $check++; }
51 if($temp2 =~ m/^3:(0|12|22|32):(0|5):/){ $check++; }
52 if($temp2 =~ m/^6:22:5:/){ $check++; }
53 if($temp2 =~ m/^7:(0|12|22|32):7:/){ $check++; }
54 if($temp2 =~ m/^99:[^:]+:[^:]+:[^:]+:[^:]+:[^:]+:[^:]+:([^:]+)/){
56 if(!exists($parts{$1})){
57 $error = $error | $ERROR_NOPARTS;
60 if($temp2 =~ m/^0:/){ $check++; }
62 $error = $error | $ERROR_STROKE_SYNTAX;
67 if($error & $ERROR_LINE_SYNTAX){
68 $result .= "** 行の構造が変です。またはコメント行が紛らわしいための誤検出の可能性があります。 **\n";
70 if($error & $ERROR_STROKE_SYNTAX){
71 $result .= "** 処理できない筆画があります **\n";
72 $temp =~ s/$error_data/<span style="color: red;">$error_data<\/span>/;
74 if($error & $ERROR_NOPARTS){
75 $result .= "** 99番で使用されている部品が存在しません **\n";
77 $result .= "$pre2\n$pre1\n==> $temp\n"."-" x 70 . "\n";
85 $result = "エラーはありませんでした\n";
89 Content-type: text/html;
92 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
93 "http://www.w3.org/TR/html4/loose.dtd">
94 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
95 <link rel="stylesheet" type="text/css" href="http://fonts.jp/green.css">
103 <p>チェック結果は以下の通りです。なお、エラーがある場合、ここれで表示される以外にもエラーがある可能性がありますので、エラー修正後、再度チェックを行ってください。</p>
107 <p><a href="checkdata.html">戻る</a></p>