Another option is a kind of Kobayashi Maru
scenario, where you can change the contraints of the underlying problem in order to derive a simpler solution.
Instead of messing with LWP, HTTP, and parsing HTML to get at the data, just get the data itself. I know you said you want to do it that way however, as an exercise; which is cool, so feel free to ignore the rest of what I'm about to say.
IMDb.com provides all of their data as well as
to their data. One of the interfaces is a suite of unix command line utilities useful for querying the data, which sounds exactly like you need. IMDb probably also appreciates the alternatives being used instead of screen scrapers.