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 "$_\n"; } } , @ARGV );