Here's a sub I wrote (it works) to change URLs to include the
tags to be outputed to HTML. You might be able to fool around with it.
sub urlcheck($newline)
{
$newline =~ s/http\:\/\//\<a href \= \"http\:\/\//ig;
if (substr ($newline, $#newline - 1, 1) eq ".")
{
$x = substr ($newline, /\G/, $#newline - 1);
}
else
{
$x = substr ($newline, /\G/);
}
$page = $x;
$page =~ s/(http\:\/\/)|(\<\/a\>)|\=|\"|(href)|(\<a)|(\w+[ ]+)//g;
$newline =~ s/$x/$x\"\>$page\<\/a\>/;
return $newline;
}
BTW, it checks to see if the URL is at the end of a sentence and therefore might have an extra period.