The Final Data Retrieval Routine 

require LWP::Simple;

my $phonelist_url   = 'http://intranet.example.com/phonelist';
my $mirror_filename = '/var/tmp/phonelist.html';


sub get_phonelist_html {
  LWP::Simple::mirror($phonelist_url, $mirror_filename);

  my $parser = XML::LibXML->new();
  $parser->recover(1);
  return $parser->parse_html_file($mirror_filename);
}