# (...) sub indexfiles { my $cod = $_[0] || die $!; my $root = $_[1] || '.'; # XXX how to correct this? our @files; find(\&wanted, $root); sub wanted { push(@files, $_) if /\.mp3$/; } open(DB, "> $dbpath/$cod.txt") || die $!; foreach(sort @files) { s/\.mp3$//; print DB $_, "\n"; } close(DB); } # (...)