#!/usr/bin/perl
# change the above path if your perl binary is elsewhere, for example
#   /usr/local/bin/perl

# by Theo Markettos <theo@markettos.org.uk>
# Placed in the public domain
# based on an example from the Squid FAQ

$|=1;
        while (<>) {
                @X = split;
                $url = $X[0];
                if ($url =~ /^.*\&[a-z]*;.*/) {
                        $url =~ s/\&amp\;/\&/;
                        $url =~ s/\&lt;/\</;
                        $url =~ s/\&gt;/\>/;
                        # add other characters here
			#
			# the 301: sends a Moved Permanently message to Browse
                        print "301:$url\n";
                } else {
                        print "$url\n";
                }
        }
