>>86
もしかすると、こうゆうことがしたいの?
foreachはいらんけど。

my $test = join '', 1..4;
print foreach $test;

それから、sortする場合以外で$a, $bを使うのは感心せんな。