il Sat, 24 Jul 2004 20:07:31 +0900, Gavin Sinclair <gsinclair / soyabean.com.au> ha scritto:: >I think you want > > lines = File.readlines('w.txt') > random_line = lines[rand(lines.size)] > >rand(n) returns an integer in the range 0...n, which is good for an >array index. > oops about rand(). OTOH I was pointing out the 'line is a user defined concept' thingy by not using readlines.