Hey, I looked at this and I think I figured out the problem with the if statement. It works for me if I add "$" before "text" and use quotes instead of number signs, like this:
if ($text =~ "http://")
When I replaced the existing line that handles the "http://..." case with the if statement, links starting with "http://" were no longer processed. I got them to work by extending the if statement, so the section looks like this:
if ($text !~ "http://")
{
$text =~ s#(^|\s)(http://\S*)#$1<A HREF="$2" $target>$2</A>#gs;
}
else
{
$text =~ s#(^|\s)(www\.\S*)#$1<A HREF="http://$2" $target>$2</A>#gs;
}
$text =~ s#(^|[^\w.-])([\w.-]*@[\w.-]+\.\w+)#$1<A HREF="mailto:$2">$2</A>#gs;
Is that a good way to do it or is there a better way?