| Posted on 2007-04-16 05:32:23-07 by mnemotronic |
| (obligatory First Post!) now on to business.. |
|
I'm trying to use BitTorrent (along with Convert::Bencode_XS, Net::BitTorrent::File, and Net::BitTorrent::PeerPacket) under ActiveState Perl 5.8.8.820 under Win XP. When I try the demo code in the BitTorrent module doc, with either a local copy of the .torrent file or a net version, I get all kinds of PHP errors. Yes, PHP. This is most unexpected. The BitTorrent module seems to be trying to do something with my Xampp PHP (I have ApacheFriends Xampp installed on this machine). The paths for Perl\site\bin and Perl\bin are before the Xampp path in my PATH env. var. Here's the offending code:
foreach (@ARGV)
{
print "arg = $_\n";
# This is pretty much right out of the demo.
my $torrentfile = $_ ;
my $torrentObject = BitTorrent->new();
my $HashRef = $torrentObject->getHealth($torrentfile);
print "Seeder: " . $HashRef->{seeder};
print "Leecher: " . $HashRef->{leecher};
} Here's the results with a local torrent file.:
C:\Documents and Settings\9855\My Documents\Src\Perl\Torrential>perl lookat_torrent.pl "CentOS-5.0-
+i386-bin-DVD.torrent"
arg = CentOS-5.0-i386-bin-DVD.torrent
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\xampp\php\ext\php_soap.
+dll' - The specified procedure could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\xampp\php\ext\php_xmlrp
+c.dll' - The specified procedure
could not be found.
in Unknown on line 0
Could not open input file: /var/lib/perl/torrent-checker.php
Use of uninitialized value in substitution (s///) at
C:/Perl/site/lib/BitTorrent.pm line 59 (#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 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 substitution (s///) at
C:/Perl/site/lib/BitTorrent.pm line 60 (#1)
Use of uninitialized value in substitution (s///) at
C:/Perl/site/lib/BitTorrent.pm line 61 (#1)
Use of uninitialized value in substitution (s///) at
C:/Perl/site/lib/BitTorrent.pm line 62 (#1)
Use of uninitialized value in concatenation (.) or string at lookat_torrent.pl
line 90 (#1)
Use of uninitialized value in concatenation (.) or string at lookat_torrent.pl
line 91 (#1)
Seeder: Leecher:
The line in Unknown on line 0 could be more descriptive... Here's the first part of the results when using a web-based torrent file:
C:\Documents and Settings\9855\My Documents\Src\Perl\Torrential>perl lookat_torrent.pl "http://www.
+fulldls.com/get_linuxapp_815"
arg = http://www.fulldls.com/get_linuxapp_815
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\xampp\php\ext\php_soap.
+dll' - The specified procedure could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\xampp\php\ext\php_xmlrp
+c.dll' - The specified procedure
could not be found.
in Unknown on line 0
Could not open input file: /var/lib/perl/torrent-checker.php
Use of uninitialized value in substitution (s///) at
C:/Perl/site/lib/BitTorrent.pm line 59 (#1)
Any suggestions would be helpful, but considering the vast emptyness of this forum, I think I shall be dying of virtual information thirst before a caravan of helpful code traders passes this way. |
| Direct Responses: Write a response |