Gen0001


※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。



aaa


sub make_out_filename {
    print "DEBUG: [ 0 ]=$_[0]<br>\n";
    my $aa = $dot_HTML_base_file_name . $_[0] . $dot_HTML_file_ext;
    print "DEBUG: $aa=$aa<br>\n";
    return($aa);
}

sub resheadprint {

print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>CGI TEST</TITLE>\n";
print "</HEAD>\n";
print "<BODY BGCOLOR='#FFFFFF' TEXT='#000000'>\n";

print("===========================================<br>\n");
print("<br>\n");

}

sub restailprint {

#
# HTMLの終わりの部分を書き出します。
#
print "</XMP>\n";
print "</BODY>\n";
print "</HTML>\n";
print "\n";

}

sub detailprint {

 print OUT "$_[0] . <BR>\n";

}

sub headprint {

# print OUT "$_<BR>\n";
print OUT "<HTML>\n";
print OUT "<HEAD>\n";
print OUT "<TITLE>CGI TEST</TITLE>\n";
print OUT "</HEAD>\n";
print OUT "<BODY BGCOLOR='#FFFFFF' TEXT='#000000'>\n";

print OUT "===========================================<br>\n";
print OUT "<br>\n";

}

sub tailprint {

#
# HTMLの終わりの部分を書き出します。
#
print OUT "</XMP>\n";
print OUT "</BODY>\n";
print OUT "</HTML>\n";
print OUT "\n";

}


$dot_control_file = "xxx.clf";
$dot_format_file = "xxx.f";
$dot_data_file = "xxx.dat";
$dot_HTML_base_file_name = "xxx";
$dot_HTML_file_ext = ".html";

$maxlpp = 5;
$i = 1;
$j = 1;

open(IN, $dot_data_file);

$outfile = make_out_filename ($j);
open(OUT, "> $outfile");

&resheadprint();

print "DEBUG: dot_HTML_base_file_name = $dot_HTML_base_file_name<br>\n";
print "DEBUG: dot_HTML_file_ext = $dot_HTML_file_ext<br>\n";
print "DEBUG: dot_data_file = $dot_data_file<br>\n";

&headprint();

while (<IN>) {

 chomp;

# print;
 print "$_<BR>\n";

 if ($i > $maxlpp) {

     # ブレーク時の処理
#     print "大きい\n";
     &tailprint();
     close(OUT);

     $j++;
     $i = 1;

     $outfile = make_out_filename ($j);
     open(OUT, "> $outfile");

     &headprint();
     &detailprint($_);

 } else {

     # ノンブレーク時の処理
#     print "小さい\n";
     &detailprint($_);
     $i++;

 }

# print OUT "$_<BR>\n";

 &tailprint();
 close(OUT);

}
close(IN);
&tailprint();
&restailprint();

 


aaa