in reply to Re: Changing .html to .asp on some links but not others
in thread Changing .html to .asp on some links but not others
If there are multiple links on one line, and any one of them is external, this solution will skip all links on that line. If a link spans more than one line, it will not be handled properly. After looking at this same problem posted here what, 4 times now, I'm thinking maybe the best approach is to use HTML::TokeParser, analyze each link (using the convenient get_tag method), and rewrite the HTML with CGI or something so it's nice and pretty.If the current line does not contain the string href="http://[anything].html then replace every instance (on this line) of href=[anything].html with href=[anything].asp
|
|---|