From: Robert Klemme Date: 2007-08-18T21:29:58+09:00 Subject: Re: How do you print the first 5 records in an array? On 18.08.2007 13:14, Konrad Meyer wrote: > On Saturday 18 August 2007 04:09:16 am Konrad Meyer wrote: >> On Saturday 18 August 2007 02:55:17 am Bob Sanders wrote: >>> Let's say I have an array defined as: >>> >>> @people = ["Jim", "Jen", "Jess", "Jay", "Jack", "John", "Jeff", "Jed", >>> "Jill"] >>> >>> How would I then print out the first 5 records of that array? (i.e. from >>> Jim to Jack) >>> >>> Any ideas? >> One idea comes to mind: >> >> @people.inject([]){|a,p|a<

> Actually: > > $><<@people.inject([]){|a,p|a<