1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/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;
}
}
|