$mech = new WWW::Mechanize; $mech->get("http://domain.com/page"); print $mech->base;