>>230 Perl5
use feature qw{current_sub say};

sub bblsort {
for (0..@_) {
sub {
if (@_ >= 2) {
__SUB__->(@_[1..$#_]);
($_[1], $_[0]) = ($_[0], $_[1])
if $_[0] > $_[1]
}
}->(@_[$_..$#_]);
}
}

use List::Util shuffle;
@a = shuffle 1..20;
say "1) @a";
bblsort @a;
say "2) @a";

実行結果
~ $ perl 13_230_bblsort.pl
1) 13 6 18 7 15 1 11 8 20 16 14 4 9 10 12 17 2 19 5 3
2) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20