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>
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|