sub ices_init { print "Perl subsystem Initializing:\n"; $jingle = 0; return 1; } sub ices_shutdown { print "Perl subsystem shutting down:\n"; } sub ices_get_next { print "Perl subsystem quering for new track:\n"; if($jingle < 12){ $jingle ++; @music=`/bin/ls -1 /home/r4l/music/*.mp3`; }else{ $jingle = 0; @music=`/bin/ls -1 /home/r4l/jingles/*.mp3`; } $num = scalar (@music); $play=int(rand($num)); chomp $music[$play]; $a=`wget ********** return $music[$play]; } sub ices_get_metadata { use MP3::Info; $tag = get_mp3tag($music[$play]) or die "No TAG info"; return "$tag->{ARTIST} - $tag->{TITLE}"; } return 1;