in reply to HTML::Tree problems with UTF-8 Content.

1. What's the best way to track down error messages like that? I was completely mystified and there were a lot of other modules involved.

If the message is being outputed by Carp::carp, try:

perl -MCarp=verbose script.pl

This will cause carp to spit out a stack trace.