go ahead... be a heretic | |
PerlMonks |
Re: Creating links in the URLs in a text paragraphby Zaxo (Archbishop) |
on Jun 25, 2007 at 04:19 UTC ( [id://623106]=note: print w/replies, xml ) | Need Help?? |
You can use Regexp::Common::URI to detect the the urls in plain text and perform a substitution. Assuming the text is in $_, the following will wrap with anchor tags, with the host as text.
Untested. The /e flag on the substitution executes the CGI::a() function to obtain the substitute. The /g flag makes the substitution for all recognised urls in the text. After Compline,
In Section
Seekers of Perl Wisdom
|
|