so you bneed to ask "why is Date::Calc returning a nonense value?"
No. The question to ask is
What is Date::Calc returning?. What you do know is that it
appears
as
-0 when printed. It could be a string. It could
be an overloaded object. But since Date::Calc deals with
numbers, it's probably a number. Now, we all know that floats
can't always be represented exactly. So, could it be that
-0 represents a small negative value, small enough
that it stringifies to
-0? Let's try:
$ perl -wle 'print -1 / (10 ** 5000)'
-0
$
I guess it can.
Note that the code of the OP was using -0 literals,
which are a totally different kind of beast.
Abigail
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.