Harry Putnam wrote:
"John W. Krahn" <jwkr...@shaw.ca> writes:

[...]

The main problem is that you are not testing edge cases like:

ev   101201 3

Or:

ev   100101 3

If you did you would get an error message like:

Month '12' out of range 0..11 at Why_is_the_answer_right.pl line 74


Thanks for the help cleaning the script up.

I may have gotten it a little less incorrect with those tips.

Input data:

ev   100409 3
  send state tax payment by 15th
ev 100604
  Newsguy account expires 100607
ev 100421 4
  my appt is today
ev 100131 3
  my appt is today
ev 101230 2
  my appt is today

You are still not testing any cases where the month and/or year need to be changed. Those only modify the day value.


------- --------- ---=--- --------- -------- #!/usr/local/bin/perl

use strict;
use warnings;
use Time::Local;

## values below hardwired so we can use Time::Local gracefully
## and we don't need any for our current job

## Changed to decimal but left them early since this will be read
## by cron only once per day...  12 would mean a late notification.
my $sec  = 3;
my $min  = 3;
my $hour = 3;

You are doing calculations on an externally provided date value so it is irrelevant to the actual time the program is being run.




John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity.               -- Damian Conway

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to