>>   $last{substr($_,0,4)}=$_ for @myArray;
>>   print join "\n", sort values %last;
>
>       Whoops, one thing wrong with this ... since you don't 
> sort before creating your hash, if the order of the data was 
> such that the newer version appears earlier in the array, 
> your results are wrong.
> Anyway you can throw the sort into the first line?

Yep. Wasn't sure if the "overriding" was higher numbers or higher
indices. You can also remove the sort at the end. Here's the update:

$last{substr($_,0,4)}=$_ for sort @myArray;
print join "\n", values %last;

-- 
Mark Thomas 
Internet Systems Architect
_______________________________________
BAE SYSTEMS Information Technology 
2525 Network Place
Herndon, VA  20171  USA 




_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to