I have a list of Referrer names with a frequency
seperated by a space, as follows:

"http://www.foo.com 140"
"http://www.bar.com 10"
"http://www.foo.com/faux 1087"

I want to sort this list by the frequency, and by the
URL, so that I get:

"http://www.foo.com/faux 1087"
"http://www.foo.com 140"
"http://www.bar.com 10"

I have tried the following script, which doesn't work
as I expected, and now I am stuck. Can anyone point me
to the right solution? Any help is much appreciated.

__SNIP__
@sort_refs = sort { &count($a) <=> &count($b) or
&host($a) cmp &host($b) } @refs;

sub count {
        shift;
        /\s+(\d+)/;
        return $1;
}

sub host {
        shift;
        /http:\/{1,2}w{0,3}.?([\w\d\.-]+)/;
        return $1;
}

TIA,

Richard


________________________________________________________________
Nokia 5510 looks weird sounds great. 
Go to http://uk.promotions.yahoo.com/nokia/ discover and win it! 
The competition ends 16 th of December 2001.

Reply via email to