From: Pritam Dey Date: 2013-03-19T10:33:27+09:00 Subject: Error in method call - need help to understand I was trying to call a method as below: $array = [] array_1 = %w(tuna salmon herring) array_2 = %w(crow owl eagle dove) def parser (*argument) argument.each do |item| $array << item end end parser (array_1,array_2) $array.flatten! puts $array Error: ===== D:/Rubyscript/My ruby learning days/Scripts/test.rb:13: syntax error, u nexpected ',', expecting ')' parser (array_1,array_2) # taking multiple arguments generates error ^ No I fixed the code by removing the space in the method call of parser as below: $array = [] array_1 = %w(tuna salmon herring) array_2 = %w(crow owl eagle dove) def parser (*argument) argument.each do |item| $array << item end end parser(array_1,array_2) # taking multiple arguments generates error $array.flatten! puts $array Output: ======= tuna salmon herring crow owl eagle dove But in the first method why such `space` causes the errors to be thrown up? -- Posted via http://www.ruby-forum.com/.