in reply to Re^2: Sort routine runs into infinite loop
in thread Sort routine runs into infinite loop

Most assuredly, your code does not implement bubble sort.

And if we are going to golf it, how about this:

perl -E 'say"2 6 9 12 15"'