in reply to Date::Calc question
my @c = reverse @a; my @d = reverse @b;
The arrays get automatically flattened afterwards in Delta_Days(@c, @d)
Edit: A little more explaining:
The join used would put a single string, with comma's in it, into the first position of an array. Thus, creating arrays with one element, so Delta_Days() would only receive 2 parameters, and those two do not expand to a number as expected, but to zero, thus Delta_Days("2015,02,01","2015,06,05") which is the equivalent of doing Delta_Days(0,0) because the function needs integers. By keeping the array as an array, the argument lists get flattened automatically for you.
If you still want the debug printing with comma's you can:
print join(",", @c) . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Date::Calc question
by flynn7312 (Acolyte) on Jul 21, 2015 at 12:51 UTC | |
by marto (Cardinal) on Jul 21, 2015 at 13:07 UTC | |
by flynn7312 (Acolyte) on Jul 21, 2015 at 13:30 UTC |