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

Learned Monks, I am getting an error when using Net-Shoutcast-Admin. Using the following code as supplied in the docs:
use Net::Shoutcast::Admin; my $shoutcast = Net::Shoutcast::Admin->new( host => 'server hostname', port => 8000, admin_password => 'mypassword', ); if ($shoutcast->source_connected) { printf "%s is currently playing %s by %s", $shoutcast->dj_name, $shoutcast->currentsong->title, $shoutcast->currentsong->artist ; } else { print "No source is currently connected."; }
... used the proper host,port, password - receive the following error: xml declaration not at start of external entity at line 2, column 0, byte 1 at C :/Perl/lib/XML/Parser.pm line 187 Any ideas? Thanks!

Replies are listed 'Best First'.
Re: Errors with Net-Shoutcast-Admin
by Anonymous Monk on Jun 10, 2009 at 13:52 UTC
    The server you're connecting to is not returning XML
      Hmmm ... but it does. If you contact the Shoutcast server directly it returns the XML...
        It isn't valid xml, so it isn't xml.