Re: Use of uninitialized value in numeric lt (<) at /Date/Manip.pm
- From: sisyphus <sisyphus359@xxxxxxxxx>
- Date: Tue, 16 Sep 2008 20:38:49 -0700 (PDT)
On Sep 17, 2:58 am, John Nagle <na...@xxxxxxxxxxx> wrote:
..
..
The line in Date::Manip that is failing is
my($tz)=$Cnf{"ConvTZ"};
$tz=$Cnf{"TZ"} if (! $tz);
$tz=$Zone{"n2o"}{lc($tz)} if ($tz !~ /^[+-]\d{4}$/);
my($tzs)=1;
$tzs=-1 if ($tz<0); ### ERROR OCCURS HERE
It's just a warning - not an error in itself. But if it's leading to
incorrect results, then there's probably something not right :-)
So Date::Manip is assuming that $Cnf has been initialized with elements "ConvTZ"
or "TZ".
I think $tz must be *initialized* by the time
$tz=$Zone{"n2o"}{lc($tz)} if ($tz !~ /^[+-]\d{4}$/);
gets run. If it were not initialized at that stage you'd get a warning
along the lines of "Use of uninitialized value $tz in pattern match
(m//) at Manip.pm line 3324. That being so, it must be the '$tz =
$Zone{"n2o"}{lc($tz)}' that's assigning undef to $tz - since there's
no other way that an initialized $tz could become uninitialized (that
I can think of, anyway).
Probably wouldn't hurt to hack in some print() statements just to see
what $tz contains at various stages - and also to check what
$Zone{"n2o"}{lc($tz)} contains. I don't know much about Date::Manip,
but my hunch is that it's the contents of $Zone{"n2o"}{lc($tz)} that's
causing the problem.
Cheers,
Rob
.
- References:
- Use of uninitialized value in numeric lt (<) at /Date/Manip.pm
- From: John Nagle
- Use of uninitialized value in numeric lt (<) at /Date/Manip.pm
- Prev by Date: Re: How to avoid multiple Inclusions of perl modules.. or how to detect mutliple inclusions.
- Next by Date: Re: How to avoid multiple Inclusions of perl modules.. or how to detect mutliple inclusions.
- Previous by thread: Use of uninitialized value in numeric lt (<) at /Date/Manip.pm
- Next by thread: How to avoid multiple Inclusions of perl modules.. or how to detect mutliple inclusions.
- Index(es):
Relevant Pages
|