title: Why am i getting the error `stack level too deep (systemstackerror)` when hashing 2 columns in a CSV?
body: <p>This is my code, which is supposed to hash the 2 columns in <code>fotoFd.csv</code> and then save the hashed columns in a separate file, <code>T4Friendship.csv</code>:</p>
  
  <pre><code>require "csv"
  
  arrayUser=[]
  arrayUserUnique=[]
  arrayFriends=[]
  
  fileLink = "fotoFd.csv"
  
  f = File.open(fileLink, "r")
  f.each_line { |line|
      row = line.split(",");
      arrayUser&lt;&lt;row[0]
      arrayFriends&lt;&lt;row[1]
  }
  
  arrayUserUnique = arrayUser.uniq
  arrayHash = []
  
  for i in 0..arrayUser.size-1
  
      arrayHash&lt;&lt;arrayUser[i]
      arrayHash&lt;&lt;i
  
  end
  
  hash = Hash[arrayHash.each_slice(2).to_a]
  
  array1 =hash.values_at *arrayUser
  
  array2 =hash.values_at *arrayFriends
  
  fileLink = "T4Friendship.csv"
  
  
  for i in 0..array1.size-1
      logfile = File.new(fileLink,"a")
      logfile.print("#{array1[i]},#{array2[i]}\n")
      logfile.close
  end
  </code></pre>
  
  <p>The first columns contains users, and the second column contains their friends. So, I want it to produce something like this in the <code>T4Friendship.csv</code>:</p>
  
  <pre><code>1 2
  1 4
  1 10
  1 35
  2 1
  2 8
  2 11
  3 28
  3 31
  ...
  </code></pre>