http://qs321.pair.com?node_id=913603


in reply to HTML::Element newline character

From the docs:
$h->as_trimmed_text
This is just like as_text(...) except that leading and trailing whitespace is deleted, and any internal whitespace is collapsed.
Here, "collapsed" means replaced with one space (just as a browser would). So, as_text may do what you want. I would be worried about how consistent the (text part) of the HTML is though. I think I might consider another approach to "reliably get the city name".