Thanks both of you,
Justin's example seems to have made it more efficient. Later on I'll
compare my original, a version with Jano's suggestions, and Justin's
using benchmark to see what is the most efficient.
Any more suggestions are welcome, of course, the more to benchmark the
merrier!
--
Posted via
http://www.ruby-forum.com/.