From: Matthew Moss Date: 2008-11-10T23:10:50+09:00 Subject: Re: Passing array instead of individual parameters? On Nov 10, 2008, at 8:05 AM, Stefan Kruger wrote: > [New to this fine language, from a Perl background] > > I expected (wrongly) the following to work - > > def myroutine(one, two, three) > puts "first: #{one} second: #{two} third: #{three}" > end > > myroutine('brave', 'new', 'world') # as expected > > # The unexpected (to me) > > myparamlist = ['brave', 'new', 'world'] > > myroutine(myparamlist) # fails > > So, my question is - is there a way of calling a routine expecting N > parameters with a list containing N elements instead? myroutine(*myparamlist)