in reply to Array Searching
For instance, how long does it take to run this:
Update: LOL. ikegami rewrote my code, but do you realize that now this routine will sort the same 100K+ list twice just to get the top 10? I mean, heck, neither of our answers is really correct when you think about the volume...perhaps the data should be pushed to a database instead?#!/usr/bin/perl -w use strict; my @addresses = qw|http://www.foo.com http://www.foo1.com http://www.f +oo2.com http://www.foo.com http://www.a.com http://www.a.com http:/ +/www.a.com http://www.a.com|; my %add; for(@addresses){$add{$_}++}; print sort {$add{$b} <=> $add{$a}} keys %add; 1;
Celebrate Intellectual Diversity
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array Searching
by ikegami (Patriarch) on Mar 09, 2006 at 20:01 UTC | |
|
Re^2: Array Searching
by cptstarfire (Initiate) on Mar 09, 2006 at 19:58 UTC |