Re: --compare current date file with previous day



David,

This is the code is the report file is in format of month&day
(ex:0925).

my %log = map { $_ => UnixDate($_, Report_%m%d.rpt) } qw{ today
yesterday };


What will be the format if that portion is generated as random numbers?
(like 1234 or 4561 something like that?

Thanks.


Shahriar wrote:
my %log = map { $_ => UnixDate($_, "Report_%m%d.rpt") }
qw{ today yesterday };

This doesn't work. There will be no " ", then it works. So far looks
great. I can parse the result. Now working to compare the results and
sending email part.

Thanks a lot for your help. Also thanks to jp.

usenet@xxxxxxxxxxxxxxx wrote:
Shahriar wrote:
if ($today[2] eq $yesterday[2])

If you want to compare the second line, you need to do:

if ($today[1] eq $yesterday[1])

because Perl arrays start at zero (so $today[0] is the first line of
the file, and $today[1] is the second line).

has this format: Report_0925.rpt

0925 means Sept 25? Using jp's approach (which I greatly prefer):

my %log = map { $_ => UnixDate($_, "Report_%m%d.rpt") }
qw{ today yesterday };

--
David Filmer (http://DavidFilmer.com)

.



Relevant Pages