Any ideas?
As it happens, yes. Note that
m#</div></div>#
will not match
</div>
</div>
because there's (vertical) whitespace between the two tags. You need \s* in your regex at points where whitespace is expected to appear between tags. And you need to slurp the entire file into memory first, since doing this line-by-line won't work.
I've not tried it, but perlrun notes that -00 will force Perl into "paragraph" mode. Given your HTML, that might be sufficient. Otherwise, investigate the other options in perlrun.
| [reply] [d/l] [select] |