Help me with CGI/Perl

Status
Not open for further replies.

Greg

Indeed.
Messages
1,600
I'm trying to write a CGI script that will generate an HTML file showing what is playing in my media player, Amarok. The command that outputs the artist and title is:
Code:
echo `dcop amarok player nowPlaying`
but when I include it in the CGI script it is just blank. The "date" command, however, works like a charm. When you load the page it will tell you the current time and date in bold, just like it should. Here is the current script with the working date command:
Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head>\n";
print "<title>Test</title></head>\n";
print "<body>\n";
print "<b>";
print `date`;
print "</b>\n";
print "</body></html>\n";
Now how do I get it to work with the other command? Keep in mind I know basically nothing about Perl.

Oh, and when I just run the script from the command line it works fine as well. Here is what it gives me:
Code:
greg@Carl:~/apache/nowplaying$ perl playing.pl
Content-type: text/html

<html><head>
<title>Test</title></head>
<body>
<b>The Flaming Lips - Superhumans
</b>
</body></html>
greg@Carl:~/apache/nowplaying$
Thanks in advance for any help, and sorry for this crappy post. It's late and I'm tired.
 
Status
Not open for further replies.
Back
Top Bottom