Mark,

        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?

Bill

-----Original Message-----
From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 05, 2006 5:32 PM
To: Ng, Bill; perl-win32-users@listserv.ActiveState.com
Subject: RE: Efficiency

Here's one:

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

I'm sure we could reduce it to a one-liner with a modified Schwarzian
Transform...

- Mark.

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

Reply via email to