Oy vey, how painful.
I can't see why the code wouldn't do what it says on the can. My guess is that somewhere in there, perhaps at
/#/ there's a mismatch between your playlist and the test criteria you apply to it, and
@playlist ends up with the wrong stuff in it. To find out what's going wrong, I'd take the first half of your code and do
open(PLAYLIST, "<playlist.m3u");
opendir(FILES, 'd:\my files');
my @playlist = ();
open TEMP ">playlist.txt";
while(<PLAYLIST>) {
if(not(/#/)) {print TEMP "$_\n"}
}
Then examine
playlist.txt at your leisure and see whether it is what you'd expect it to be. Of course, before you run this... make sure you don't have a treasured file called playlist.txt that will get overwritten... that would be just too cruelly ironic.
Please do post again and say how you get on and ask any other questions that occur to you. Perl is your friend, really, despite appearances.
§
George Sherston
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.