move functions at the bottom

and turn the main script into a modulino
This commit is contained in:
Yanick Champoux 2023-08-26 10:29:15 -04:00
parent 40407e9604
commit e923b1106a

View File

@ -9,6 +9,12 @@ use WWW::Mechanize ();
use experimental qw/ signatures /; use experimental qw/ signatures /;
unless(caller) {
my $ts = get_mersenne_results();
generate_output_table($ts)->draw;
}
sub get_mersenne_results() { sub get_mersenne_results() {
# log in to Mersenne.org and get results for the last year # log in to Mersenne.org and get results for the last year
@ -40,10 +46,6 @@ sub get_mersenne_results() {
return $te->first_table_found; return $te->first_table_found;
} }
my $ts = get_mersenne_results();
generate_output_table($ts)->draw;
sub generate_output_table ($ts) { sub generate_output_table ($ts) {
# group GHZ Days results by computer, compute GHZ Days per Day (GHZ Days / Days) # group GHZ Days results by computer, compute GHZ Days per Day (GHZ Days / Days)