dlita has asked for the wisdom of the Perl Monks concerning the following question:

CDDSearch does not install and work on a windows 7 (32 bit) machine. I've narrowed it down to the get command failing. I put the test.pl new(DEBUG=>1); to try to trouble shot this. All i get is a fully qualified url that is correct and the not ok 2 not ok 3 ... errors. firewall is off. any thoughts?

Replies are listed 'Best First'.
Re: CDDBSearch does not install windows 7
by Corion (Patriarch) on Nov 15, 2010 at 15:21 UTC

    Why don't you show us what the error messages are, and what you do?

    In the chatterbox, we had already narrowed down at least one of the errors to missing prerequisites that Net::CDDBSearch fails to specify (libwww-perl and URI::Escape).

    Maybe you show us more of what you tried then, and how it failed for you. Despite claims to part-time mentalism, we are not psychic.

      Sorry, i also installed libwww-perl on suggestions from chatterbox that didn't help. here's what i did to the test.pl code and the output.

      use Net::CDDBSearch; $loaded = 1; print "ok 1\n"; $cddb = Net::CDDBSearch->new(DEBUG=>1); $cddb->get_albums_artist('Megadeth'); $albums = $cddb->albums(); push(@s,$_) foreach keys %{$albums}; if ($#s > 0) { print "ok 2\n"; } else { print "not ok 2\n"; } $cddb = Net::CDDBSearch->new(); $cddb->get_albums_album('Youthanasia'); $albums = $cddb->albums(); push(@a,$_) foreach keys %{$albums}; if ($#a > 0) { print "ok 3\n"; } else { print "not ok 3\n"; } $cddb = Net::CDDBSearch->new(); $cddb->get_songs_album($a[0]); $info = $cddb->info(); $tracks = $cddb->tracks(); if ($info->{Title} ne '') { print "ok 4\n"; } else { print "not ok 4\n +"; } push(@t,$_) foreach keys %{$tracks}; if ($#t > 0) { print "ok 5\n"; } else { print "not ok 5\n"; } use Net::CDDBSearch; $loaded = 1; print "ok 1\n"; $cddb = Net::CDDBSearch->new(DEBUG=>1); $cddb->get_albums_artist('Megadeth'); $albums = $cddb->albums(); push(@s,$_) foreach keys %{$albums}; if ($#s > 0) { print "ok 2\n"; } else { print "not ok 2\n"; } $cddb = Net::CDDBSearch->new(); $cddb->get_albums_album('Youthanasia'); $albums = $cddb->albums(); push(@a,$_) foreach keys %{$albums}; if ($#a > 0) { print "ok 3\n"; } else { print "not ok 3\n"; } $cddb = Net::CDDBSearch->new(); $cddb->get_songs_album($a[0]); $info = $cddb->info(); $tracks = $cddb->tracks(); if ($info->{Title} ne '') { print "ok 4\n"; } else { print "not ok 4\n +"; } push(@t,$_) foreach keys %{$tracks}; if ($#t > 0) { print "ok 5\n"; } else { print "not ok 5\n"; }
      any ideas what else i can do?

        Where's the output? Copy/paste error?

Re: CDDBSearch does not install windows 7
by marto (Cardinal) on Nov 15, 2010 at 15:25 UTC

    It's often helpful to show us the output from your installation attempt along with the script you're running and the output (wrapped in <code></code> tags). See Writeup Formatting Tips. Since this has been discussed at some length in the CB previously, perhaps you should also clearly state which version of Perl you're running, since IIRC you dumped 5.12.x in favour of 5.10.x for this module from 2004. Have you tested LWP::Simple? Can you use it to access remote sites?

    It's no fun for us to have to guess any of this, How do I post a question effectively? gives some useful posting advice worth reading.

Re: CDDBSearch does not install windows 7
by dlita (Initiate) on Nov 15, 2010 at 16:16 UTC

    Sorry i dodn't mention i installed libwww-perl. here is the modification i made to the test.pl script to see what was going on

    use Net::CDDBSearch; $loaded = 1; print "ok 1\n"; $cddb = Net::CDDBSearch->new(DEBUG=>1); $cddb->get_albums_artist('Megadeth'); $albums = $cddb->albums(); push(@s,$_) foreach keys %{$albums}; if ($#s > 0) { print "ok 2\n"; } else { print "not ok 2\n"; } $cddb = Net::CDDBSearch->new(); $cddb->get_albums_album('Youthanasia'); $albums = $cddb->albums(); push(@a,$_) foreach keys %{$albums}; if ($#a > 0) { print "ok 3\n"; } else { print "not ok 3\n"; } $cddb = Net::CDDBSearch->new(); $cddb->get_songs_album($a[0]); $info = $cddb->info(); $tracks = $cddb->tracks(); if ($info->{Title} ne '') { print "ok 4\n"; } else { print "not ok 4\n +"; } push(@t,$_) foreach keys %{$tracks}; if ($#t > 0) { print "ok 5\n"; } else { print "not ok 5\n"; } output C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>perl test.pl 1..1 ok 1 Net::CDDBSearch=HASH(0x377d2c) >> Calling _get_albums(); Net::CDDBSearch=HASH(0x377d2c) >> Calling _get_url(); Net::CDDBSearch=HASH(0x377d2c) >> URL: http://www.freedb.org/freedb_se +arch.php?a llfields=NO&allcats=YES&grouping=none&words=Megadeth&fields=artist not ok 2 not ok 3 not ok 4 not ok 5 C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>C:\dnload\Net-CDDBSe +arch-2.01\ Net-CDDBSearch-2.01>perl test.pl 'C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01' is not recognized +as an inte rnal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>1..1 '1..1' is not recognized as an internal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>ok 1 'ok' is not recognized as an internal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>Net::CDDBSearch=HASH +(0x377d2c) >> Calling _get_albums(); The filename, directory name, or volume label syntax is incorrect. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>Net::CDDBSearch=HASH +(0x377d2c) >> Calling _get_url(); The filename, directory name, or volume label syntax is incorrect. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>Net::CDDBSearch=HASH +(0x377d2c) >> URL: http://www.freedb.org/freedb_search.php?a The filename, directory name, or volume label syntax is incorrect. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>llfields=NO&allcats= +YES&groupi ng=none&words=Megadeth&fields=artist 'llfields' is not recognized as an internal or external command, operable program or batch file. 'allcats' is not recognized as an internal or external command, operable program or batch file. 'grouping' is not recognized as an internal or external command, operable program or batch file. 'words' is not recognized as an internal or external command, operable program or batch file. 'fields' is not recognized as an internal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>not ok 2 'not' is not recognized as an internal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>not ok 3 'not' is not recognized as an internal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>not ok 4 'not' is not recognized as an internal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>not ok 5 'not' is not recognized as an internal or external command, operable program or batch file. C:\dnload\Net-CDDBSearch-2.01\Net-CDDBSearch-2.01>

    any thoughts on what else i can try?

    Rob i took the url produced by putting the test.pl in debug mode and copied and paste it into firefox and it works. I'm guessing it has something to do with the way the string is quoted before its sent. Maybe URI escape? Thanks dlita

      Try adding a shebang line at the top of test.pl:

      #!/usr/bin/perl

      That said, if you actually read test.pl you're only creating one instance with the Debug option, as you see it creates a new one for subsequent tests. As I mentioned in the CB, the first test check to see if it can load the module, the subsequent tests actually test the six year old code against the freedb site. Chances are it (the site) may have changed and this module isn't scraping it properly anymore, or there is something going wrong with accessing webpages. I asked this previously but you've not responded.

      any thoughts on what else i can try?

      I guess you could try fixing the module (... it looks broken to me). On Windows Vista, I'm getting the same as you when I run test.pl:
      1..1 ok 1 Net::CDDBSearch=HASH(0x2eb164) >> Calling _get_albums(); Net::CDDBSearch=HASH(0x2eb164) >> Calling _get_url(); Net::CDDBSearch=HASH(0x2eb164) >> URL: http://www.freedb.org/freedb_se +arch.php?a llfields=NO&allcats=YES&grouping=none&words=Megadeth&fields=artist not ok 2 not ok 3 not ok 4 not ok 5
      I expect the output would be the same on all operating systems, not just windows.
      The get_albums_artist and get_albums_album methods seem to be doing their job, but the albums method is not doing what it's supposed to do - perhaps this is the result of some re-structuring done to the website from which the information is being retrieved. I haven't checked.

      Cheers,
      Rob

      UPDATE: Don't be fooled by the 'PASS' reports from the cpan-testers. The first and only report that I checked, while purporting to be a 'PASS', should in fact be a 'FAIL'