From: Leon Bogaert Date: 2007-10-05T08:35:34+09:00 Subject: Re: Add files to array matching pattern This would work: i = 0; dir = "/home/leon/"; test = Array.new; test = Dir.new(dir).entries.map! { |x| x =~ /filezilla$/ ? x : next }; test.compact Is the .compact needed? Can't I get rid of that? -- Posted via http://www.ruby-forum.com/.