From b2b6cb5bacbefed1e8142dd096d70a110a4d4e87 Mon Sep 17 00:00:00 2001 From: robbie-hatley Date: Sun, 30 Jun 2024 19:58:44 -0700 Subject: Minor tweaks. --- challenge-276/robbie-hatley/perl/ch-1.pl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/challenge-276/robbie-hatley/perl/ch-1.pl b/challenge-276/robbie-hatley/perl/ch-1.pl index 2b66f7f281..560b9ba3f4 100755 --- a/challenge-276/robbie-hatley/perl/ch-1.pl +++ b/challenge-276/robbie-hatley/perl/ch-1.pl @@ -48,19 +48,18 @@ Output is to STDOUT and will be each input followed by the corresponding output. =cut # ------------------------------------------------------------------------------------------------------------ -# PRAGMAS, MODULES, VARIABLES, AND SUBS: - -use v5.38; -$"=', '; -sub complete_days (@times) { - my $cds = 0; - for ( my $i = 0 ; $i <= $#times - 1 ; ++$i ) { - for ( my $j = $i + 1 ; $j <= $#times - 0 ; ++$j ) { - 0 == ($times[$i]+$times[$j])%24 and ++$cds; +# PRAGMAS, MODULES, AND SUBS: + + use v5.38; + sub complete_days (@times) { + my $cds = 0; + for ( my $i = 0 ; $i <= $#times - 1 ; ++$i ) { + for ( my $j = $i + 1 ; $j <= $#times - 0 ; ++$j ) { + 0 == ($times[$i]+$times[$j])%24 and ++$cds; + } } + $cds; } - $cds; -} # ------------------------------------------------------------------------------------------------------------ # INPUTS: @@ -81,6 +80,7 @@ my @arrays = @ARGV ? eval($ARGV[0]) : # ------------------------------------------------------------------------------------------------------------ # MAIN BODY OF PROGRAM: +$"=', '; for my $aref (@arrays) { say ''; my @times = @$aref; -- cgit