Jesús Gabriel y Galán wrote:
> But you still need the outer iteration. If I'm already iterating with
> #each, I change it to map to do both things at the same time :-)

Of course. But for a newcomer to ruby (who is still using 'for' instead 
of 'each'), it may be easier to take one step at a time along the road 
to enlightenment.

Step 1:

threads = []
for page in str
  threads << Thread.new do
    ...
  end
end

Step 2:

threads = []
str.each do |page|
  threads << Thread.new do
    ...
  end
end

Step 3:

threads = str.map do |page|
  Thread.new do
    ...
  end
end
-- 
Posted via http://www.ruby-forum.com/.