in reply to HTML::Element newline character
From the docs:
$h->as_trimmed_textHere, "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".
This is just like as_text(...) except that leading and trailing whitespace is deleted, and any internal whitespace is collapsed.
In Section
Seekers of Perl Wisdom