>>816 Pop関数はこっちの方がいいな、無駄なコピーもないし。

sub Pop($a) {
 my $b = @$a[-1];
 delete @$a[-1];
 $b;
}