title: When returning a list of items in an array, I am getting Errno::EINVAL: Invalid argument in Textmate - but NOT IRB
body: <p><em><strong>See updates below</em></strong></p>
  
  <p>So this is my code:</p>
  
  <pre><code>def add_category(new_url)
      new_url + '/web/'
  end
  
  url = 'http://www.someurl.com'
  
  def modify_my_list(list)
      puts "The number of links in this list are: #{list.count}"
      list.each do |i, k|
            k = add_category(k)
                puts k
      end
  end
  
  modify_my_list(list)
  </code></pre>
  
  <p>Basically what I am doing is going through a list of links that are on a specific URL and processing them.</p>
  
  <p>But the output I am seeing (i.e. the list of links) is less than what I know I should be seeing.</p>
  
  <p>In other words, the number of links that are being printed on my screen is less than the amount that is printed from <code>list.count</code>.</p>
  
  <p>This is the error I am getting:</p>
  
  <pre><code>Errno::EINVAL: Invalid argument
  
  method write    in my-search.rb at line 83   =&gt;     puts k
  method puts in my-search.rb at line 83
  method modify_my_list   in my-search.rb at line 83
  method each in my-search.rb at line 81   =&gt;     list.each do |i, k|
  method modify_my_list   in my-search.rb at line 81
  at top level    in my-search.rb at line 87 =&gt; modify_city_list(list)
  </code></pre>
  
  <p>Thoughts?</p>
  
  <p><strong>Update</strong></p>
  
  <p>When I do a <code>puts list.inspect</code> it outputs the entire array and doesn't throw an error. The error seems to come once I start iterating through the array.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>So I am encountering this error when I run it in Textmate. However, I took the output from <code>list.inspect</code> and did it in IRB. Then I modified the list elements in IRB and it works without giving me an error. Could it be Textmate throwing this error and not Ruby or my script?</p>