use File::Find; my @mp3s; my $startdir="/home/slycer/mp3s" #/home/slycer/test find sub {push (@mp3s, $File::Find::Name) if /\.mp3/},$startdir;