RE: Duplicate Entries in Array

2003-01-07 Thread Carl Jolley
On Tue, 7 Jan 2003, Peter Eisengrein wrote: > %hash = @array; > > Now the keys of %hash are the unique values in @array. > Not exactly. The even elements will become the %hash keys and the odd elements will become the values. If @array contains an odd number of elements you'll get a run-time erro

Re: Duplicate Entries in Array

2003-01-07 Thread Carl Jolley
On Tue, 7 Jan 2003 [EMAIL PROTECTED] wrote: > I need to be able to generate a unique list from a list that could > possibly have duplicate entries in it. Has anyone developed an easy way > to do that? > The most straignt forward way is to create a hash slice from the list by using the list eleme

RE: Duplicate Entries in Array

2003-01-07 Thread Peter Eisengrein
So it is, so it is... hmmm... when I did it I must've made my @array just happen to work. Argh! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 4:20 PM To: [EMAIL PROTECTED] Subject: RE: Duplicate Entries in Array &g

RE: Duplicate Entries in Array

2003-01-07 Thread shurst
> %hash = @array; > > Now the keys of %hash are the unique values in @array. Umm, nope, now the keys of %hash are the unique even index values of @array. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveS