diff options
| author | Jaime <42359730+bracteatus@users.noreply.github.com> | 2019-08-01 10:17:02 -0600 |
|---|---|---|
| committer | Jaime <42359730+bracteatus@users.noreply.github.com> | 2019-08-01 10:17:02 -0600 |
| commit | 3340d5c7c3068d643b0297e4ad1971fbd1be024b (patch) | |
| tree | 6a050d7f4db94f3115f6f379ed826e5fbc40512b /challenge-019 | |
| parent | 36d969bf392d2c2464dd30aec1868d5326abf4ad (diff) | |
| download | perlweeklychallenge-club-3340d5c7c3068d643b0297e4ad1971fbd1be024b.tar.gz perlweeklychallenge-club-3340d5c7c3068d643b0297e4ad1971fbd1be024b.tar.bz2 perlweeklychallenge-club-3340d5c7c3068d643b0297e4ad1971fbd1be024b.zip | |
Remove subprocess pipes. Use more native regex filters.
Diffstat (limited to 'challenge-019')
| -rw-r--r-- | challenge-019/jaime/perl5/ch-1.pl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/challenge-019/jaime/perl5/ch-1.pl b/challenge-019/jaime/perl5/ch-1.pl index 6f59f1dccd..74e7c065d4 100644 --- a/challenge-019/jaime/perl5/ch-1.pl +++ b/challenge-019/jaime/perl5/ch-1.pl @@ -5,9 +5,8 @@ for my $year (1900..2019) { for my $month (1, 3, 5, 7, 8, 10, 12) { + my $cal = `cal -h -m $month $year`; # print months with 31 days that start on a Friday. - if `cal -h -m $month $year | tail -n 6` =~ /^\h+1\h+2\h*\v/; { - print `cal -h -m $month $year`; - } + print $cal if $cal =~ /^(\V+\v+){2}\h+1\h+2\h*\v/; } } |
