diff --git a/script.pl b/script.pl index 941d075..3a157d6 100644 --- a/script.pl +++ b/script.pl @@ -37,13 +37,18 @@ sub get_mersenne_results() { # load the results into a table object my $html_string = $mech->content; - $html_string =~ s/\n//g; + return extract_first_table($html_string); +} + +sub extract_first_table($html) { + $html =~ s/\n//g; my $te = HTML::TableExtract->new( depth => 0, count => 2 ); - $te->parse($html_string); + $te->parse($html); return $te->first_table_found; + } sub generate_output_table ($ts) {