| blib/lib/App/puzzl/new.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 11 | 16 | 68.7 |
| branch | 0 | 2 | 0.0 |
| condition | n/a | ||
| subroutine | 4 | 5 | 80.0 |
| pod | 0 | 1 | 0.0 |
| total | 15 | 24 | 62.5 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 7 | use strict; | |||
| 1 | 2 | ||||||
| 1 | 42 | ||||||
| 2 | 1 | 1 | 15 | use v5.28; | |||
| 1 | 4 | ||||||
| 3 | package App::puzzl::new; | ||||||
| 4 | 1 | 1 | 8 | use Exporter 'import'; | |||
| 1 | 2 | ||||||
| 1 | 83 | ||||||
| 5 | 1 | 1 | 8 | use File::Path qw(make_path); | |||
| 1 | 2 | ||||||
| 1 | 224 | ||||||
| 6 | |||||||
| 7 | sub new_day { | ||||||
| 8 | 0 | 0 | 0 | my ($day) = @_; | |||
| 9 | |||||||
| 10 | 0 | make_path('days'); | |||||
| 11 | |||||||
| 12 | 0 | 0 | open(my $code, '>', "days/day$day.pl") or die "failed to open file days/$day.pl"; | ||||
| 13 | |||||||
| 14 | 0 | print $code <<'EOF'; | |||||
| 15 | use strict; | ||||||
| 16 | use v5.28; | ||||||
| 17 | |||||||
| 18 | sub part1 { | ||||||
| 19 | my ($input_fh) = @_; | ||||||
| 20 | } | ||||||
| 21 | |||||||
| 22 | sub part2 { | ||||||
| 23 | my ($input_fh) = @_; | ||||||
| 24 | } | ||||||
| 25 | EOF | ||||||
| 26 | 0 | close($code); | |||||
| 27 | } | ||||||
| 28 | |||||||
| 29 | our @EXPORT_OK = qw(new_day); | ||||||
| 30 | |||||||
| 31 | 1; |