Perl入学式について振り返ってみた

#!/usr/bin/env perl
use utf8;
use 5.012001;

use DDP {deparse => 1};

my @list = ();

while (my $in = <>) {
    chomp $in;
    if ($in == 1) {
        print '>>> ';
        my $msg = <>;
        unshift @list, $msg;
    }
    if ($in == 2) {
        print @list;
    }
    if ($in == 9) {
        exit;
    }
}

Comments

comments powered by Disqus