in reply to file (mp3) list shown on website as links
Someone correct me if I'm wrong but this eliminates the need to keep track of operating system dependent file delims, too, doesn't it?use strict; use File::Find; #path can be relative to script dir or absolute path my $MP3ROOT = 'my_music'; #my $MP3ROOT = 'C:\\My Documents\\My Music'; #regex is case insensitive my $MP3SUFFIX = '.mp3'; my $PREFIX = 'http://www.homepage.org/'; #my $PREFIX = 'C:\\My Documents\\'; @ARGV = @ARGV || ( $MP3ROOT ); find( sub { if ( ( $File::Find::name =~ /$MP3SUFFIX$/i ) and ( $File::Find::dir !~ /^\./ ) ) # discard .hidden dirs { print "<a href=\"$PREFIX$File::Find::name\">$_</a>\n"; } } , @ARGV );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: file (mp3) list shown on website as links
by Nimster (Sexton) on Dec 23, 2000 at 22:35 UTC | |
by ichimunki (Priest) on Dec 24, 2000 at 02:13 UTC | |
by salvadors (Pilgrim) on Dec 31, 2000 at 03:07 UTC | |
by ichimunki (Priest) on Dec 31, 2000 at 18:17 UTC | |
by salvadors (Pilgrim) on Dec 31, 2000 at 22:01 UTC |