However when I try and compare the variable with nil it still comes out as false.
At first I thought it was because gets was including the escape character \n at the end of the empty string, however when I use gets.chomp it still evaluates as false
input = gets.chomp puts (input == nil)
false Press any key to continue . . .
PS. I'm a bit new to this so I mightn't have used the correct terms or explained that very well.