#!/usr/bin/perl -w use strict; die "Usage: ", $0 =~ /([^\/]+)$/, " \n" unless @ARGV; $^I = ''; # We're really brave - no backup file! while (<>){ next unless /./; # Skip empty lines tr/A-Z/a-z/; # Lowercase the lot s#^(?!http://)#http://#; # Prefix 'http://' if one is missing print; }