Glad it worked. :-) My only question is this covers Tues through the following Tuesday (8 days) and it seems that Tuesdays are getting reported twice. I am not familiar with PAR or pp. But, you could do this with a module that has been a part of the Perl core since the beginning of Perl 5.0. POSIX has the function strftime. It involves a little more code and isn't as simple as Date::Simple but will give the same results and you may not have to package it with your program (as it is part of the Perl core).
#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw/ strftime /;
my @dmy = (localtime)[3 .. 5]; # day-month-year
my $today = strftime "%Y%m%d", (0) x 3, @dmy;
$dmy[0] -= 8; # 8 days before
my $wk_before = strftime "%Y%m%d", (0) x 3, @dmy;
while (<DATA>) {
print if $_ ge $wk_before && $_ lt $today;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.