From: Conrad Schneiker Date: 2000-11-23T11:12:57+09:00 Subject: [ruby-talk:6539] Re: Question about the behavior of write attributes in blocks Hmm, no answer yet? Where is everyone? Christoph writes: # I lifted the following two lines from your (great) book - Page 285 # ************ # a = ["a","b","c","d"]. # a.collect! {|x| x+"!"} # p a # ************* # which has the output # >> undefined method `a' for ["a", "b", "c", "d"]:Array (NameError) Well, since AFAIK, all the code in the book always got run (and error-code checked) in the process of text generation, let's start by looking for transcription errors. Hmm, I don't see any period in the book at the end of the "a = ..." statement. Sure enough, if I remove the trailing period in your example, the error message goes away. The error message is somewhat puzzling and counterintuitive, however (at least for me). Conrad Schneiker (This note is unofficial and subject to improvement without notice.)