in reply to Using File::Find with a bit of elegance

Including "$!" as part of that first error message is useless. "$!" is only for system error messages, like why you can't open a file and such. Also, as long as the purpose of your function is to write filenames, there's no point in saving them in an array (IMO):
sub indexfiles { my $cod = shift || die "Must supply filename!"; my @dirs = @_ ? @_ : "."; open(DB, ">$dbpath/$cod.txt") or die "Error: $!"; my $fh = select(DB); local $\ = "\n"; find( sub { local $_ = $_; print if s/\.mp3$//; }, @dirs); close DB; select($fh); }
----------
ooo  O\O  ooo tilly was here :,(