>-----Original Message-----
>From: drieux [mailto:[EMAIL PROTECTED]]
>>
>> sub unique {
>
>neat function....
>
>> }
>
>may I counter propose based upon the benchmarks....
>
>http://www.wetware.com/drieux/pbl/BenchMarks/uniqbyRefOrArray.txt
>
>ciao
>drieux
>
>---
>
>ps: harry, I have referenced you as the originator
>of the function - if that is incorrect - please send
>me email back channel indicating who should be blamed.....
I know my last attempt was pretty shit but how do these fair. Do not pass
references but the arrays themselves and let me know how it gets on. I think
its faster than the original grep method. I know its ugly but its quick.
sub unique {
foreach (@_) { $_{$_}++}
return [keys %_];
}
Or you could butcher the grep method as I have done to get the following
sub GrepMe {
return [ grep { not $\{$_}++ } @_ ];
}
The above methods are a horrible way to abuse globals but I enjoyed seeing
how fast I could get them to run. I reckon that you could get them to go a
little bit quicker.
Harry.
*************************************************************************************
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. +44 20 7390 3900
This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message. Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.
*************************************************************************************
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]