From e923b1106a059c7ae97af3495d1aa71582788f33 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 26 Aug 2023 10:29:15 -0400 Subject: [PATCH] move functions at the bottom and turn the main script into a modulino --- script.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/script.pl b/script.pl index e36225d..941d075 100644 --- a/script.pl +++ b/script.pl @@ -9,6 +9,12 @@ use WWW::Mechanize (); use experimental qw/ signatures /; +unless(caller) { + my $ts = get_mersenne_results(); + + generate_output_table($ts)->draw; +} + sub get_mersenne_results() { # 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; } -my $ts = get_mersenne_results(); - -generate_output_table($ts)->draw; - sub generate_output_table ($ts) { # group GHZ Days results by computer, compute GHZ Days per Day (GHZ Days / Days)