use strict; use File::Find; open (MP3, ">c:/perltest/mp3test.txt"); my @directories = (".", "c:/"); my @foundfiles; # Here, we collect all .mp3 files below each directory in @directories # and put them into @foundfiles find( sub { push @foundfiles, $File::Find::name if /\.mp3$/ }, @directories ); # and output them all print join("\n", @foundfiles), "\n"; $, = ','; $/ = "\n"; print MP3 ("\n", @foundfiles), "\n"; close (MP3);