changing links (was Re: [thelist] Copying HTML from PC to Mac)

Sam-I-Am sam at sam-i-am.com
Thu Jul 20 16:11:54 CDT 2000


> you
> can change the hyperlinks in the HTML (which could be easy to do
> with a regexp, but the question was keeping filenames, not
> changing links)...

so people always say.. but I've yet to find a comprehensive and
practical solution to the problem of manipulating links across a whole
site.
I'm currently putting together a perl script that I hope will address
_my_ needs - to be able to convert a site from using document relative,
root relative, and absolute paths to whatever - where "links" normally
includes img src, a href, link href, td background, table background,
script src, .. etc.)

(I'm using HTML::TreeBuilder, (with HTML::ELement), File::PathConvert,
URI::URL... for this atm. Being a relative perl newbie this is a
(welcome) challenge :)

Then there are css @imports, not to mention the mess you can get into
with javascript - where the dependancies may even be assembled by a
script on the fly. (And not to mention serverside processing which would
reveal new links and dependancies)

So it's far from trivial IMO. 
Any tools, pointers, experiences, links on this subject would be very
appreciated.

Sam




More information about the thelist mailing list