From: "David A. Black" Date: 2009-02-02T21:34:24+09:00 Subject: Re: Variable declarations on one line Hi -- On Mon, 2 Feb 2009, Frisco Del rosario wrote: > a="al", b="bob", c="carl" > > Why is a an array containing al, bob, carl, and not a string "al"? It's because of the precedence and assignment-order rules. It's read as: a = x,y,z which means that a is [x,y,z]. Meanwhile, y is this: b = "bob" and z is this: c = "carl" So you end up with a, b, and c all assigned, but not quite the way you wanted. Try this: a, b, c = "al", "bob", "carl" David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) http://www.wishsight.com => Independent, social wishlist management!