#!/usr/bin/perl use strict; use CGI qw/:standard/; my $c = new CGI; my $datafile = "/full/path/to/playlist.txt"; my $width = $c->param("width") || 0; my $height = $c->param("height") || 0; my $autostart = $c->param("autostart")|| "true"; my $loop = $c->param("loop") || "false"; my $showtitle = $c->param("showtitle")|| "true"; my $fntstyle = $c->param("fntstyle") || "Arial"; my $fntsize = $c->param("fntsize") || 4; my $fntbold = $c->param("fntbold") || "true"; open(GETDATA, "$datafile"); @Data = ; close(GETDATA); srand(time & $$); my $number = rand(@Data); my $line = @Data[$number]; chomp($line); ($title,$midi) = split(/\|/, $line); print header; if ($showtitle eq "true") { print ""; print "" if $fntbold eq "true"; print "$title"; print "" if $fntbold eq "true"; print "\n"; } print "<bgsound src=\"$midi\" loop=true>\n"; exit (0);