From: Jamis Buck Date: 2003-12-12T07:55:15+09:00 Subject: Re: Appending to an array Thomas Adam wrote: >vthread << File.new(pathname, >"r").readlines().to_s().grep(/^foobar/).uniq() > > The << operator for array only appends the single object given to the end of the array--it does not concatenate one array onto another. What you probably want is the += operator: vthread += File.new(...).grep(/^foobar/).uniq() (Assuming, of course, that vthread is an array.) -- Jamis Buck jgb3@email.byu.edu ruby -h | ruby -e 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'