« Iraq on the Record Database | Main | shipyard dorkbot »

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Mie

I'm relieved it went well. I saw you go through all that although I didn't really know what was going on. I'm so proud of you!

mfrumin

you said you need to "store the data in a hash table where the key is the requested url and the value is an array of all the different unique refers for that post"

my $d = {};
while() {
my ($req_url, $refer) = parse_line($_);
if(!exists($d->{$req_url})) {
$d->{$req_url} = {};
}
$d->{$req_url}->{$refer} = 1;
}

foreach my $k (keys %$d) {
print "URL: $k\n";
foreach my $r (keys %{$d->{$k}}) {
print "\tREFERER: $r\n";
}
}

this could definitely be done in many fewer lines, but i thought i'd be more expressive just for illustration's sake.

obviously i'm working at home and procrastinating the shit out of my friday afternoon.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name is required. Email address will not be displayed with the comment.)