in reply to Re: Re: it's been awhile . . .
in thread it's been awhile . . .
btw, it's kinda been awhile since i used perl, and i don't remember exactly what {$playlist{$_} = 1} does, or how it does it. could someone refresh my memory? yeah, i know, i really should start commenting thingsuse strict; open(PLAYLIST, "<test.m3u"); my $dir = 'c:\my files'; opendir(FILES, "$dir"); open (TEST, ">test.txt"); my %playlist; my @filelist = grep {/\.mp3$/} readdir FILES; my $song; while(<PLAYLIST>) { chomp; if(not(/#/)) {$playlist{$_} = 1} } foreach $song(@filelist) { if(!exists $playlist{$song}) { print TEST $dir . "\\" . $song . "\n" } } closedir FILES; close PLAYLIST;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: it's been awhile . . .
by pike (Monk) on Oct 11, 2001 at 14:47 UTC |