Date::Calc::Add_Delta_YM() undefined

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I'm using the Date::Calc module and its subroutine Add_Delta_YM(), but the
PERL debugger is telling me that Add_Delta_YM() is an undefined
subroutine. I have version 4.3 of the module.

In its discussion of Add_Delta_YM() versus Add_Delta_YMD(), the
documentation at:
says that Add_Delta_YM() is a new subroutine.
Is the version of the module installed on my Unix box, version 4.3, the
latest version, or is it older than the documentation I found on the web?

I'm having no problem with several other subroutines from the module. For
example, I did:
($y, $m, $d) = Add_Delta_Days (2005, 5, 2, 3);
was successful - it resulted in the correct values for $y, $m and $d.

Here's what I'm doing:

(I ran the PERL debugger:)
/usr/local/bin/perl -de 0

use Date::Calc qw(:all);
$v = Date::Calc::Version();
print $v;
(The above printed: 4.3)

(Next, I wanted to add one month to May 10, 2005:)
($y, $m, $d) = Add_Delta_YM (2005, 5, 10, 0, 1);

(The resulting debugger message was that the subroutine was undefined:)
(Partial screen shot leaving in the PERL debugger prompts:)
$<2>  DB<5> $<2>($y, $m, $d) = Add_Delta_YM (2005, 5, 10, 0, 1);
Undefined subroutine &main::Add_Delta_YM called at (eval 6) line 2.
        eval '($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D =
$^D |
($y, $m, $d) = Add_Delta_YM (2005, 5, 10, 0, 1);;

;' called at /usr/local/lib/perl5/5.00503/ line 1239
        DB::eval called at /usr/local/lib/perl5/5.00503/ line
        DB::DB called at -e line 1

$<2>  DB<6> $<2>                                                              
(End of screen shot.)


Re: Date::Calc::Add_Delta_YM() undefined

* schrieb:
Quoted text here. Click to load it

You answers your question by yourself. Yes, you've a version problem.
Try to install a new version from CPAN, currently 5.4.">


Re: Date::Calc::Add_Delta_YM() undefined

On Sun, 01 May 2005 03:04:58 +0000, develop wrote:

Quoted text here. Click to load it

Well, in the CHANGES.txt file of the current version 5.4 you can find

Version 5.0   10.10.2001

Module "Date::Calc":

 +  Added the following new functions:
     *  check_time()
     *  Delta_YMD()
     *  Delta_YMDHMS()
     *  Add_Delta_YM()
     *  Add_Delta_YMDHMS()
     *  Normalize_DHMS()

That means that your version 4.3 is still to old and you should update
your Date::Calc module (at least to version 5.0) as Fabian also has
already suggested.


Site Timeline