>     c = gets

One more point: that should say "c = STDIN.gets" for an interactive program.

"c = gets" will work until you try to pass arguments on the command line
(using ARGV). That's because the bare 'gets' will treat those arguments as
the names of files to read.

Regards,

Brian.