From: Robert Klemme Date: 2009-02-03T04:59:55+09:00 Subject: Re: Noob question: while or for loop within a list On 02.02.2009 20:40, Darin Ginther wrote: > list = "A,B,C,D" > list.split(", ").each do |url| > puts "URL IS:"+url > end > > Output: URL IS:A,B,C,D > > > > Is using an array a "more correct" way to do it in Ruby? Yes. You can use the word modifier for easier typing: urls = %w{http://foo.bar http://www.google.gov} Now you can do puts urls urls.each do |url| puts "URL is #{url}" end If you want to do URL manipulations check out class URI. http://www.ruby-doc.org/core/classes/URI.html Kind regards robert