in reply to Find and replace

Greetings.

You are probably looking for either HTML::Parser or its brethren HTML::Treebuilder.

Cheers
alf