The while loop executes its contained code while a condition that you specify remains true.
while($_ != "q") puts "Running..." print "Enter q to quit: " gets chomp end