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
    so im stuck again... i can not find a function in Date::Calc, which can check for date "order", eg. one date (from) is before another (to).

      Take a look at the module documentation, Delta_Days returns the difference in dates, if the $difference (in your example) is negative then date 2 occurred this number of days before date 1.

      Update: Fixed typo.

        perfect, thank you!