title: Saving and calling multiple variables from ruby method
body: <p>Maybe I've been staring at my Ruby book to the point where words don't mean anything anymore, but I thought I might as well ask.   </p>
  
  <p>What I'm looking to do is, rather than passing a bulk of variables through my function headers, or instead of using global variables, I'm looking to save my variables within a method, and call upon them at multiple times, throughout my functions.  What I'm realistically having an issue with, is scope.  </p>
  
  <pre><code>def DateGrab()
   print "\nEnter the date you're looking for (Month/Day): "
   longdate = gets.strip.split(/\/| /)
   if longdate[0].length &gt; 3
     month = longdate[0].slice(0..2)
   else
     month = longdate[0]
   end
    day = longdate[1]
    year = `date | awk '{print $6}'`.strip
    grepdate = "#{day}/#{month}/#{year}"
    date = Date.parse("#{day}-#{month}-#{year}").strftime('%m%d%Y').strip
  end
  </code></pre>
  
  <p>I'm looking to pass "grepdate" and "date" through multiple functions, and I feel that using a method would be easier, but every time I try to call the variable, I get a "undefined local variable or method" error.  </p>