I havn't come across a post that made laugh as hard is this one in a while (mostly because I've been away).Once I figured out what was being sought I neerly dove
in to the regexing I think that the ranking algorithm holds the intrigue.I'm not sure if I've made the code more or less accessable.Anyway it made me think.
#! /usr/bin/perl
# Authored By :DReKurCe
# Fri Jun 10 21:10:33 EDT 2005
use warnings;
use strict;
my @mostcommon=qw(www com org edu );
my @urlist =qw (
www.to2600.org
www.perlmonks.org
www.darkphiber.ca);
graburl(@urlist);
sub graburl {
my @urlist=@_;
my $listlen=@urlist;
foreach my $url(@urlist){;
urlcom(@mostcommon,$url);
}
}
sub urlcom{
my $url;
(@mostcommon,$url)=@_;
for my $match0(@mostcommon){
my @atomize=split (//,$url);
foreach $atom(@atomize){
if (<masterful regex>)rank($url,1)
else(<masterful regex>)rank($url,2)
.
.
.
}
}
}
sub rank{
<impliment ranking behaviour for url>
}