From: Josh Cheek Date: 2011-08-12T21:35:33+09:00 Subject: Re: I/O learning resource --20cf307ca1e85be60404aa4e2427 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Aug 12, 2011 at 7:20 AM, Allen Wyma wrote: > Excuse me. I'm guessing you're coming from a zero programming experience. > Gets waits for keyboard input and puts displays a string (text) to the > screen. Would you like an example? > > Name = gets() > Puts = Name > > Anything junky about that? > Variables that begin with capital letters are constants in Ruby. Probably `Name` shouldn't be a constant. Methods aren't constants, so their names are all lowercase, so `Puts` should actually be `puts`. A slight reinterpretation of this program: name = gets puts "Hello, #{name}" If it makes you feel more comfortable being explicit, this translates (approximately) to: name = $stdin.gets() $stdout.puts("Hello, #{name}") --20cf307ca1e85be60404aa4e2427--