Sorry, this is another reply that's not a direct and complete answer.
In fact, it's well OffTopic as far as the Perl element of your question
But I would recommend, strongly against uppercasing html tags.
- Doing so will make switching to XHTML, should the need arise, more difficult, as tags like <HTML> or <P...> or <DIV...> don't comply with the XHTML standard.
- I'd also point out that blithely converting the original files to .old from either.html or .htm runs a risk of (sequentially) processing 1.htm and 1.html (well, having both in a single system is no wackier, IMO, that the conversion you're seeking to do) which would mean the total loss of the original of 1.htm, when the processed version of 1.html is (subsequently) written to the same dir.