I posted an Array permutation method to the RubyGarden wiki last year:
http://rubygarden.org/ruby?ArrayPermute

It uses the same recursive method, although it yields a block for each
permutation rather than returning an array of permutations.  Thanks to
your post, however, I have made a small improvement (the length < 2
test).

Paul.