in reply to use Perl to maintain blocked host file

The code below simply parses your hosts file and turns it into a web page full of links which you can then check manually. You could update the code to actually 'get' the URL and test it. (I won't be doing that from behind my corporate proxy!). There are also freely available applications that will check whether links are active.

One potential problem is that the dubious web sites (particularly advertising ones) do not always have a homepage. If you try and access http://mysite.com/ they can just return a 404 error which may lead you to assume that the site cannot be found or served etc.

#! /usr/bin/perl -w use strict; print "<html><body>\n"; while (<DATA>) { #remove leading and trailing whitespace s/^\s+//; s/\s+$//; #split into an array my ($dummy, $url) = split /\t/, $_; #do something with the url print "<a href=\"http://$url\">$url</a><br>\n" if $url; } print "</body></html>\n"; __DATA__ ################################################################### + # # + # Created by Alan Bradley on 1-03-04 # + # # + # this list currently has 61882 different blocked servers # + # # + # # + # # + ################################################################### 0.0.0.0 00.goodoo.ru 0.0.0.0 00.smi.ru 0.0.0.0 000.2.links4trade.com 0.0.0.0 0000hits.net etc.