in reply to WWW::Mechanize get($variable)

See the update_html method. The example that comes with it does exactly what you want.