Using URI module to find and set link; how to ignore tag

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm using URI::Find and URI::Escape to locate links, and to convert
them to a coded link. Like this:

$finder = URI::Find -> new(
  sub {
    ($uri, $orig_uri) = @_;
    return "<a href='$uri' target='_new'>$orig_uri</a>";

$finder -> find($contents);

If you enter , then it will convert it to <a
href=' ' target='_new'>http://</a>.

This works great, unless someone enters the code for an image. Then,
it converts:

<img src=''>

(which should be OK) to:

<img src='<a href=''

How can I modify the script to make it ignore addresses that are
within <img> tags?



Site Timeline