Hi,

At Fri, 6 Dec 2002 07:42:32 +0900,
Jason Persampieri wrote:
> (1) << (or .push) doesn't change the array... I have
> to do foo[key] = foo[key].push(value).  This is ok,
> but wouldn't it make sense to have <<= or .push!
> methods?  But this is completeness stuff and obviously
> not a priority for Matz.

`foo[key]<<=value' works as `foo[key]=foo[key]<<value'.

foo = Hash.new {[]}	# 1.7 feature
data.each {|line|
  line =~ /^(.*?)=(.*)$/
  foo[$1.strip] <<= $2.strip
}

-- 
Nobu Nakada