From: Lee Jarvis Date: 2007-12-07T01:44:55+09:00 Subject: Re: regular expression. newbie problem. Johnathan Smith wrote: >> You are aware that you are trying to input ruby code into a unix shell, >> yes? > > yes > but then i tried in irb too but still having problems > > h-3.2$ irb > irb(main):001:0> name.rb > NameError: undefined local variable or method `name' for main:Object > from (irb):1 > irb(main):002:0> a = Name.new("John Matthew Johnson") > NameError: uninitialized constant Name > from (irb):2 > > i know im probably being very thick here but i appreciate the help You need to require the file with the Name class in it. But in this case. Copy the code I gave you, (the class and the main code) open up a shell and cd to the directory of the script and run: ~$ ruby name.rb Regards, Lee -- Posted via http://www.ruby-forum.com/.