File Coverage

blib/lib/App/puzzl/run.pm
Criterion Covered Total %
statement 11 25 44.0
branch 0 4 0.0
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 15 35 42.8


line stmt bran cond sub pod time code
1 1     1   8 use strict;
  1         2  
  1         42  
2 1     1   12 use v5.28;
  1         4  
3             package App::puzzl::run;
4              
5 1     1   6 use Exporter 'import';
  1         2  
  1         33  
6 1     1   868 use Module::Load;
  1         1876  
  1         10  
7              
8             sub run_day {
9 0     0 0   my ($day) = @_;
10              
11 0 0         if($day eq 'all') {
12 0           my @days = glob("days/day*.pl");
13 0           foreach my $day_found (@days) {
14 0           run($day_found);
15             }
16 0           return;
17             }
18              
19 0 0         open(my $input_fh, "<", "input/day$day.txt") or die "failed to open input file input/day$day.txt";
20 0           do "./days/day$day.pl";
21 0           say '=== PART 1 ===';
22 0           part1($input_fh);
23              
24 0           seek($input_fh, 0, 0);
25 0           say '=== PART 2 ===';
26 0           part2($input_fh);
27              
28 0           close($input_fh);
29             }
30              
31             our @EXPORT_OK = qw(run_day);
32              
33             1;