From: Glenn Jackman Date: 2010-01-22T07:25:11+09:00 Subject: Re: an elegant way to modify all lines from file by using map() function? At 2010-01-21 05:17PM, "RobertGawron" wrote: > I'm new in ruby and I just have a question: in python when I want to > read all lines from file, do something with all of them and then use > them in my program I use map function + lambda function, sth like > that: > > print map(lambda u: u.upper(), open("foo", "r").readlines()) puts File.readlines("foo").map {|l| l.upcase} -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous