Tuna has asked for the wisdom of the Perl Monks concerning the following question:
As is,#!/usr/bin/perl -w #find-missing-files.pl use strict; use Date::Calc qw( Delta_Days Add_Delta_Days ); my (@start, @stop); my $from = $ARGV[0]; my $to = $ARGV[1]; $from =~ s/-/,/g; $to =~ s/-/,/g; #@start = $from; print "@start\n"; #@stop = $to; print "@stop\n"; @start = (1999,05,27); @stop = (1999,06,01); my $j = Delta_Days(@start,@stop); for ( my $i = 0; $i <= $j; $i++ ) { my @date = Add_Delta_Days(@start,$i); printf("%4d-%02d-%02d\n", @date); }
will produce the following output:./find-missing-files.pl
But, uncomment:1999-05-27 1999-05-28 1999-05-29 1999-05-30 1999-05-31 1999-06-01
comment this:#@start = $from; print "@start\n"; #@stop = $to; print "@stop\n";
and run:@start = (1999,05,27); @stop = (1999,06,01);
it returns:./find-missing-files.pl 1999-05-27 1999-06-01
Can anyone explain what's going on here?1999,05,27 1999,06,01 Usage: Date::Calc::Delta_Days(year1, month1, day1, year2, month2, day2 +) at ./test.pl line 19.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(zdog) Re: Weird Date::Calc behavior; Bug?
by zdog (Priest) on Apr 19, 2001 at 08:51 UTC | |
| |
|
Re: Weird Date::Calc behavior; Bug?
by nardo (Friar) on Apr 19, 2001 at 08:45 UTC |