Re: sort and keep the latest version



In article <442cf240$0$4996$db0fefd9@xxxxxxxxxxxxxx>, Dave Weaver
<zen13097@xxxxxxxxx> wrote:

Jim Gibson <jgibson@xxxxxxxxxxxxxxxxx> wrote:
Katie <hoa19ngo@xxxxxxxxx> wrote:

for ( $i = 0; $i < $#sortedList; $i++ ) {

for my $i ( 0 .. $#sortedList ) {

You have an off-by-one error.

for my $i ( 0 .. $#sortedList - 1 ) {

Right, thanks. I missed that one. Therefore, my comment about going
past the end of the array is retracted with apologies.
.