From: Thorsten Haude Date: 2002-04-22T04:50:40+09:00 Subject: Re: Novice: Each and p Moin, * Armin Roehrl [02-04-21 17:28]: > judging from the email address you might >be abloe to read German: Most of the times, yes. >http://approximity.com/rubybuch/ Looks good, but if anything, it increased my problems. If I try to execute this file: - - - Schnipp - - - #! /usr/bin/ruby -w # # This is free software; you can redistribute and/or modify it under the # the terms of version 2 the GNU General Public License as published by # the Free Software Foundation. See http://www.gnu.org/copyleft/gpl.html 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. ruby 1.6.3 (2001-03-19) [i686-linux] Is there a standard way to verify a sane environment? >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. >If not, look at the excellent >online book by the pragmatic programmers: >http://www.rubycentral.com/book/index.html I had a look at this, but I couldn't find anything directly related to my problems. And there's no index. >A quick way to get info on let's say 'p' >is to use ri. Great tip! I'm sure I will use this once or twice in the future. Thanks for your help! Thorsten -- As long as people will accept crap, it will be financially profitable to dispense it. - Dick Cavett