Hi, * Stefan Schmiedl <s / xss.de> [02-04-21 22:52]: >Thorsten Haude <ruby / thorstenhau.de> wrote: >> File.open("/home/yooden/.mail/keywords") { |file| >> file.each_line { |line| >> print line if line =~ /Ruby/ >> end >> } >> - - - Schnapp - - - >> I get a parse error at line ten. This is an example from your book, so >> I'm afraid something is wrong with my setup. >This proves that 20 eyes see more than the 18 (presumably) which >were employed for proofreading. You are doing fine, we have a typo. ^^^^^^^^ Do you need my KtoNr. and BLZ? >> Is there a standard way to verify a sane environment? >if in doubt, use the windows way: reinstall :-) Ah, so you want to scare me off? I'm not frightened that easily. >>>About "each" look at >>>http://www.approximity.com/rubybuch2/node24_main.html >>>and especially read "Iteratoren". >> The problem I had was more in the two |'s. What exactly is the meaning >> of these? Do they just mean "Here's the name of whatever I iterate >> upon"? Is there any side effect, anything more to know? >> The reason I wonder is simply that this looks unusual to me. >each_line yields one value to the code block, and you choose to >denote it by "line" inside your block. There is another iterator >"each_with_index" for sequences, where the block receives two values, >which you could denote "| value, index |" or "| index, value |", I >keep forgetting which one is correct. I think I understand it now. It was more an unfamiliar syntax than anything else. >You might also want to check out the German Ruby list: >http://www.unix-ag.uni-siegen.de/mailman/listinfo/ruby-de/ I'm subscribed, but this list seemed to be far more active, so I tried here first. Is there a special list for novices, English or German? Thanks for your help! Thorsten -- I was amazed today to find out how much Windows can actually be used for useful things. - Donald E. Knuth