Advice on HTML editting

2010-04-29 Thread Victoria Conlan
It's been a while since I actually got to write some Perl (considering what I do for a living!), so I thought I'd try and make this one as sensible as possible. I've hit a snag in my implementation. I have . I want to loop through them pick out all the image tags change the pat

Re: Advice on HTML editting

2010-04-29 Thread Roger Burton West
On Thu, Apr 29, 2010 at 11:14:40AM +0100, Victoria Conlan wrote: > My first thought was a simple RE, then I decided that was silly and started > looking at modules. HTML::Parser and HTML::TreeBuilder are what I've looked > at so far. What I tend to do in this sort of situation is use HTML::TokeP

Re: Advice on HTML editting

2010-04-29 Thread Victoria Conlan
For this sort of thing, HTML::Parser should suffice. By default it just prints the HTML it's just parsed, so it's a case of writing a suitable handler to look for the appropriate IMG tags and then mutate them and print them. Ok, I'll give it a go. (I got as far as using LinkExtor to extract

Re: Advice on HTML editting

2010-04-29 Thread Peter Corlett
On 29 Apr 2010, at 11:14, Victoria Conlan wrote: [...] > I have . > I want to > > loop through them > pick out all the image tags > change the path of some (particular ones, not arbitrary!) > save the new html (possibly with a backup, but not essential) > (then some other stuff)

Re: Advice on HTML editting

2010-04-29 Thread Jacqui Caren-home
Roger Burton West wrote: On Thu, Apr 29, 2010 at 11:14:40AM +0100, Victoria Conlan wrote: My first thought was a simple RE, then I decided that was silly and started looking at modules. HTML::Parser and HTML::TreeBuilder are what I've looked at so far. What I tend to do in this sort of situa

Re: Advice on HTML editting

2010-04-29 Thread Ovid
- Original Message > From: Roger Burton West > What I tend to do in this sort of situation is > use HTML::TokeParser (which is just an alternative > interface to HTML::Parser that matches better with > the way I work) and re-emit everything except the > tokens that I want to fiddle wit