From: Robert Klemme Date: 2006-07-08T01:41:00+09:00 Subject: Re: hyphens in variable names 2006/7/7, Paul Hepworth : > > Omitting the quotes would give a syntax error: > > > > $ irb > > >> hash = {} > > => {} > > >> hash[:tree-list] > > NameError: undefined local variable or method `list' for main:Object > > That is the error that I saw all too often. Yeah, that's caused by Ruby parsing ":foo" "-" "bar". Sorry, I should have used the proper syntax, Jacob is right of course, you need :"foo-bar" or :'foo-bar'. So the list of options now looks like this object.send "foo-bar" object.send :"foo-bar" object["foo-bar"] object[:"foo-bar"] Plus same methods with double quotes replaced by single quotes. robert -- Have a look: http://www.flickr.com/photos/fussel-foto/