title: What's the point of ARGV in Ruby?
body: <p>What's the point of ARGV in Ruby?</p>
  
  <pre><code>first, second, third = ARGV 
  puts "The script is called: #{$0}"
  puts "Your first variable is: #{first}"
  puts "Your second variable is: #{second}"
  puts "Your third variable is: #{third}"
  </code></pre>
  
  <p>What's the point of this when to run the file I need to do:</p>
  
  <pre><code>ruby ex1.rb
  </code></pre>
  
  <p>and to put in the first, second and third variables I need to type in</p>
  
  <pre><code>ruby ex1.rb blah blah blah
  </code></pre>
  
  <p>How does this benefit at all the person running the program? They can't do it anyway since I'd assume it be an executable:</p>
  
  <pre><code>user = ARGV.first
  prompt = '&gt; '
  
  puts "Hi #{user}, I'm the #{$0} script."
  puts "I'd like to ask you a few questions."
  puts "Do you like me #{user}?"
  print prompt
  likes = STDIN.gets.chomp()
  
  puts "Where do you live #{user}?"
  print prompt
  lives = STDIN.gets.chomp()
  
  puts "What kind of computer do you have?"
  print prompt
  computer = STDIN.gets.chomp()
  
  puts &lt;&lt;MESSAGE
  Alright, so you said #{likes} about liking me.
  You live in #{lives}.  Not sure where that is.
  And you have a #{computer} computer.  Nice.
  MESSAGE
  </code></pre>
  
  <p>Can someone please explain this to me?</p>