sorting of arrays

2002-09-04 Thread Quincy Ntuli
I understand that perl desides how it stores data in an array. does it make sense for me to ... @sorted = sort @list;

RE: sorting of arrays

2002-09-04 Thread David . Wagner
mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 04, 2001 05:16 To: [EMAIL PROTECTED] Subject: sorting of arrays I understand that perl desides how it stores data in an array. does it make sense for me to ... @sorted = sort @list; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: sorting of arrays

2002-09-04 Thread Felix Geerinckx
on Tue, 04 Sep 2001 12:15:37 GMT, Quincy Ntuli wrote: > I understand that perl desides how it stores data in an array. Perl doesn't, you do. Data in an array is indexed by an integer. You, the programmer, choses at which position you put your data: $array[0] = 0; $array[1] = 1; Or,

Re: sorting of arrays

2002-09-05 Thread zanardi2k2
Felix Geerinckx wrote: > (...) > Or, by using push, you take the next available position: > > push @array, 3; > > is the same as > $array[2] = 2; > (...) Maybe a typo? push @array, 3; should be the same as $array[2] = 3; -- Zanardi2k2 -- To unsubscribe, e-m

Re: sorting of arrays

2002-09-05 Thread Felix Geerinckx
on Thu, 05 Sep 2002 08:46:08 GMT, [EMAIL PROTECTED] (Zanardi2k2) wrote: > Felix Geerinckx wrote: > >> push @array, 3; >> >> is the same as >> $array[2] = 2; >> (...) > > > Maybe a typo? > > push @array, 3; > > should be the same as > > $array[2] = 3; Indeed.