When outputting HTML, it's often handy to be able to turn any URL, such as http://www.whatever.com, into a hyperlink, such as
<A HREF="http://www.whatever.com">http://www.whatever.com</A>.
You can do this with a regular expression in Perl:
open (FILE, "myfile.txt");
while (<FILE>) {
if (/http:/) {
s{(http:[^\s]*)} {<A HREF="$1">$1</A>}gs;
}
print;
}
Any string in myfile.txt which contains http: will be turned into a hyperlink.