cg wrote:
> having read "Programming Ruby: the pragmatic programmer"s Guide" I tried the
> following "range"-example mentionned in the LOOPS section:
> 
> file = File.open("ordinal)
> while file.gets
>     print if /third/ .. /fifth/
> end
> 

Try:

file = File.open("ordinal")
while a = file.gets
     print a if (/third/ =~ a) .. (/fifth/ =~ a)
end

See http://www.rubygarden.org/ruby?ProgrammingRubyTwo/Expressions#loops

(or go to http://www.phrogz.net/ProgrammingRuby when checking things in 
Programming Ruby that may have changed from 1.6 to 1.8)

> Am I doing something wrong here ? Is the range-class broke ?

I think this is part of the cleaning up of Ruby that Matz is doing, but 
I'm not sure. The original code relies on a hidden variable and lots of 
magic that can seem too Perlish.

-- 
(\[ Kent Dahl ]/)_    _~_    _____[ http://www.pvv.org/~kentda/ ]_____/~
  ))\_student_/((  \__d L b__/     Master of Science in Technology     )
( \__\_/__/ ) _)  Industrial economics and technology management (
  \____/_\____/ (____engineering.discipline_=_Computer::Technology___)