Okay... here's the next hurdle..
I need to use regular expressions or something for this one but can't work it out myself...
I have a filename that takes the form:
www.somedomain.com.gif (or jpg, or png)
basically a url then the image file extension.
I want to end up with the url as a variable (let's call it $url if that's okay)
so I can print a string that looks like this:
<A HREF="$url"><IMG SRC="$filename" ALT="Visit $url"></A>