use WWW::Mechanize; [...] my @links = $mech->links();