aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobbie-hatley <Robbie.Hatley@gmail.com>2024-06-30 19:58:44 -0700
committerrobbie-hatley <Robbie.Hatley@gmail.com>2024-06-30 19:58:44 -0700
commitb2b6cb5bacbefed1e8142dd096d70a110a4d4e87 (patch)
treefac00dbb1deedb17895f344d236bd5b398c15c75
parentfd0dfc57df65fef42db64d2c57eadd5962e2c006 (diff)
downloadperlweeklychallenge-club-b2b6cb5bacbefed1e8142dd096d70a110a4d4e87.tar.gz
perlweeklychallenge-club-b2b6cb5bacbefed1e8142dd096d70a110a4d4e87.tar.bz2
perlweeklychallenge-club-b2b6cb5bacbefed1e8142dd096d70a110a4d4e87.zip
Minor tweaks.
-rwxr-xr-xchallenge-276/robbie-hatley/perl/ch-1.pl22
1 files 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;