http://qs321.pair.com?node_id=1202123


in reply to Batch remove URLs

using a find/replace one liner

Please see Parsing HTML/XML with Regular Expressions, I think a module like Mojo::DOM will be much more reliable.

As for batch processing, I'd suggest a module like File::Find::Rule or perhaps Path::Class's recurse method (although the find method you showed here works too, if your script only processes one file at a time).

For that list of 300 URLs, you could perhaps build a regex out of them which you could then use to search (after having safely parsed the file with one of the modules mentioned in the link above ;-) ). If you need advanced handling of URLs, use the URI module.