in reply to Easier way to do this

per jeffa's suggestion, this node has a disclaimer.

THIS NODE CONTAINS NO PERL CODE AND SUGGESTS A SOLUTION OTHER THAN PERL.
it appears that `sort` below can be broken with embedded newlines.(thanks, tilly) shame on you for using embedded newlines in your mp3 names. :)
and now, for something completely different...

Other people have commented on File::Find, which is useful and 100% perl. However, I have also run into this problem and found it to be more shell-esque than perl-esque (at least in my situation, ymmv).

I use the following shell script, which requires slocate. The good news is it has regex abilities. Soooooo, I wrote this small script which is very useful:

#!/bin/bash slocate -U /home/mp3 -o /home/mp3/mp3s.sldb ; rm -f /home/mp3/playlist_* ; rm -f /home/httpd/html/playlist/playlist_* ; slocate -d /home/mp3/mp3s.sldb -r '\.[Mm][Pp]3$' | sort > "/home/mp3/ +playlist_`date | cut -c1-3`_`date | awk '{print $4}' | cut -d: -f1,2` +" ; chown alex.wheel /home/mp3/playlist_* ; cp /home/mp3/playlist_* /home/httpd/html/playlist ; chown alex.wheel /home/mp3/mp3s.sldb ;
its really cut-and-dry, very fast, and does exactly what you want. just slap it in your ~/.crontab or whereever your distro prefers. Note, this assumes you use /home/httpd/html, it might be something like /usr/local/apache/htdocs/html or somesuch. The output of this is available on my homenode. Of course /home/mp3 is probably not where you keep your mp3's either.

--
#!/bin/dep