Subject: | BUG - TVDB-API -Use of uninitialized value |
Date: | Fri, 09 Jan 2015 15:58:14 +0100 |
To: | bug-TVDB-API [...] rt.cpan.org |
From: | Torsten Rusch <beaufort12 [...] web.de> |
Hi!
I get the following if I call TVDB::API::new and enable diagnostics:
my $tvdb = TVDB::API::new({
apikey => $apikey,
lang => $language,
cache => $cache_file
});
Use of uninitialized value in sprintf at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 120 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a
mistake.
To suppress this warning assign a defined value to your variables.
To help you figure out what was undefined, perl will try to tell you
the name of the variable (if any) that was undefined. In some cases
it cannot do this, so it also tells you what operation you used the
undefined value in. Note, however, that perl optimizes your program
and the operation displayed in the warning may not necessarily appear
literally in your program. For example, "that $foo" is usually
optimized into "that " . $foo, and the warning will refer to the
concatenation (.) operator, even though there is no . in
your program.
Use of uninitialized value in sprintf at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 121 (#1)
Use of uninitialized value in sprintf at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 122 (#1)
Can't use an undefined value as an ARRAY reference at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 84 (#2)
(F) A value used as either a hard reference or a symbolic reference
must
be a defined value. This helps to delurk some insidious errors.
====
If I call it like this:
my $tvdb = TVDB::API::new([[$apikey], $language]);
I get:
Use of uninitialized value in sprintf at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 120 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a
mistake.
To suppress this warning assign a defined value to your variables.
To help you figure out what was undefined, perl will try to tell you
the name of the variable (if any) that was undefined. In some cases
it cannot do this, so it also tells you what operation you used the
undefined value in. Note, however, that perl optimizes your program
and the operation displayed in the warning may not necessarily appear
literally in your program. For example, "that $foo" is usually
optimized into "that " . $foo, and the warning will refer to the
concatenation (.) operator, even though there is no . in
your program.
Use of uninitialized value in sprintf at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 121 (#1)
Use of uninitialized value in sprintf at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 122 (#1)
Warning: TVDB::API: download
http://thetvdb.com/api/ARRAY(0x177fa70)/mirrors.xml, 404 Not Found
Uncaught exception from user code:
Could not find tvdb.xml in ./ at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 271.
XML::Simple::find_xml_file(XML::Simple=HASH(0x2bac280),
"tvdb.xml", "./") called at /usr/local/lib64/perl5/5.20.1/XML/Simple.pm
line 236
XML::Simple::parse_file(XML::Simple=HASH(0x2bac280), undef,
"ForceArray", ARRAY(0x29c4288)) called at
/usr/local/lib64/perl5/5.20.1/XML/Simple.pm line 193
XML::Simple::XMLin(undef, "ForceArray", ARRAY(0x29c4288))
called at /usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 271
TVDB::API::getAvailableMirrors(TVDB::API=HASH(0x177fb48),
undef) called at /usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 293
TVDB::API::chooseMirrors(TVDB::API=HASH(0x177fb48)) called at
/usr/local/lib64/perl5/5.20.1/TVDB/API.pm line 87
Hope it helps to debug:
Greetz