68user's page 掲示板

Prev< No. 2252> Next  [最新発言に戻る] [過去ログ一覧]
No. 2252 # ナナシサソ 2001/11/07 (水) 23:34:55
動くかわからんけどとりあえずできた

sub read_file_to_array { #←?
        my $file = shift;
        open (FILE, "<$dir\\$database\\Defect\\$file") or die "Can't open $file\n";
        open (OUT1, ">$dir\\$database\\Defect\\${file}_1") or die;
        open (OUT2, ">$dir\\$database\\Defect\\${file}_2") or die;
        my ($flag1, $flag2);
        while (<FILE>) {
                if ( /-1/ ) {
                        $flag1 = 1;
                }
                if ( /-2/ ) {
                        $flag2 = 1;
                        $flag1 = 0;
                }
                if ($flag2) {
                        print OUT2;
                        next;
                }
                if ($flag1) {
                        print OUT1;
                        next;
                }
        }
}

Prev< No. 2252> Next  [最新発言に戻る] [過去ログ一覧]