On Sun, 3 Jun 2001, KeN ClarK wrote:

> I bought O'Reilly's PERL In A Nutshell last evening and have been lurking
> here for awhile. I'm curious if any answers exist for this question:
>
> I want to take mp3's in a directory and create html page with href links
> to these files. There are far too many of them to just create the page
> raw. Assuredly this can be done. W/Linux, I've figured out how to recreate
> the page all the way to reading the *.mp3 contents...but then I get stuck.
> I have limited language experience.
>
> Any suggestions?

Try using Apache::MP3 (available on CPAN) if you want to make a
streaming MP3 server.  If you want just a directory listing, Apache
has the built-in feature of listing files in a directory if there's
no index file. You should also use http://search.cpan.org and search
for "MP3"; that might give you something useful.

If you want to use Perl in a plain CGI, something like this in your
CGI will be what you want:

opendir (DIR, '/my/mp3/dir') or die;
while (defined ($file = readdir (DIR) )) {
    print "<A HREF='$file'>$file</A>\n";
}

(This isn't complete code, but it should be a start. I used the
*Perl Cookbook* to find it.)

srl
-- 
Shane R. Landrum         [EMAIL PROTECTED]
we generate our own light to compensate for the lack of light from above -AD
GPG public key: http://cs.smith.edu/~slandrum/srl_pgpkey.txt

Reply via email to