# my 'music' directory contains over 5000 files # so the fastest way to be listed: D:\tree /f /a .\music > \music_list.txt # later the following script is 'move'd to # %systemroot%\system32 ### begin use strict; my $argv = join '.*', @ARGV; my $song = qr/\|(?!\+\S{3})(\s.*?)$argv/i; my $clean = qr/^\W+(.+?)\W+$/; my $file = 'd:\music_list.txt'; my $album = q::; open my $fh, $file or die "cannot open $file: $!$/"; while(<$fh>){ /(\\|\+)-{3}/ and $album = $_ and next; if (/$song/) { s/$clean/$1/ for $_, $album; $album ? print "album: $album$/","song: $_$/$/" : print "album: . $/","song: $_$/$/"; $main::counter++; } } print "$/total: $main::counter song(s) found$/" if $main::counter; __END__ ### end # finally D:\copy ffind.pl %systemroot%\system32 D:\ffind.pl compare album: Good music song: Sinead O'Connor - Nothing Compares 2 U.mp3 album: party song: Sinead O'Conner - Nothing Compares To You.mp3 total: 2 song(s) found