I have a simple test program (see below). When I run it directly through perl, I get the expected output. However, if I first PAR up the program and try to run the resulting executable, I get the following error message.
Name "Date::Manip::Lang::english::Language" used only once: possible typo at Date/Manip/Base.pm line 1844.
Not an ARRAY reference at Date/Manip/Date.pm line 1351.
I do not understand what it means or how to work around it. Does anyone have any suggestions?
use strict;
use warnings;
use Date::Manip;
my @dateObject;
push @dateObject, ParseDateString('1/12/2010 10:44:49 AM');
push @dateObject, ParseDateString('1/12/2010 10:44:59 AM');
print "Delta is " . interval_to_sec(DateCalc(@dateObject)) . " seconds
+\n";
# parse interval string and yield seconds
sub interval_to_sec {
my ($intv) = @_;
my ($sec) = 0;
my $sign = ($intv =~ /^-/) ? -1 : 1;
my @f = reverse(split(/:/, $intv));
# use just 5 least significant fields
$sec = $f[0];
$sec += $f[1] * 60;
$sec += $f[2] * 3600;
$sec += $f[3] * 86400;
$sec += $f[4] * 604800; # 7 days
$sec += $f[5] * 2629800; # 30.4 days (365.25 / 12)
$sec += $f[6] * 31557600; # 365.25 days (Julian year)
return $sign * $sec;
}
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.