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>
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.