title: How does the split function in combination with multiple variables work?
body: <p>I have the following lines of code in an app but I'm unable to understand how the <code>split</code> function works. I mean why are there two variables separated by a comma on left hand side of line no. 8 and what exactly is this for loop doing?</p>
  
  <pre><code>def execute_testcases
    file_names = []
    originalfile_filewithtime = []
    original_file_map = {}
    originalfile_filewithtime = params[:excelfile]
    puts originalfile_filewithtime
  
    for value in originalfile_filewithtime
      original_file, file_with_time = value.split(',') # THIS LINE
      original_file_map[file_with_time] = original_file
      file_names &lt;&lt; file_with_time
    end
  
    # Some more code...
  end
  </code></pre>