68user's page 掲示板

Prev< No. 2669> Next  [最新発言に戻る] [過去ログ一覧]
No. 2669 # 68user 2002/05/03 (金) 17:19:29
>>2668 a-jmj
こんな感じでしょうか。

    open(IN,"file");
    while (<IN>){
        chomp;
        local($date) = (split /<>/)[0];
        push(@{$line_{$date}}, $_);
    }
    close(IN);
    
    foreach $date (sort keys %line_ ){
        foreach (@{$line_{$date}}){
            print "$_ ";
        }
        print "\n";
    }

実行結果:
    1<>aaaa<> 1<>bbbb<>
    2<>cccc<>

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