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


In reply to Re: Easier way to do this by deprecated
in thread Easier way to do this by LoneRanger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.