From: Mark Van De Vyver Date: 2007-05-09T20:08:20+09:00 Subject: Re: newbie: assign values/array to variables Thank you David and Gary! Regards Mark On 5/9/07, Gary Wright wrote: > > On May 9, 2007, at 6:41 AM, Mark V wrote: > > > Hi, > > Thanks for all the fantastic work that has gone into ruby. Even > > though I am new it has proved to be very impressive. > > To my question. > > I've seen the following code: > > > > @vara, @varb = "ab,ac,ad,ae".split(",") > > > > the way @vara and @varb were used makes me think the writer expected > > the following: > > > > puts @vara.inspect # "ab" > > puts @varb.inspect # ["ac", "ad", "ae"] > > @vara, *@varb = "ab,ac,ad,ae".split(",") > > The asterisk (or 'splat') operator is the key. > > Gary Wright > >