On Thu, 2007-01-18 at 11:44 -0500, Mathew wrote:
> open FILE, "H:\My Music\folderlist.txt";
> 
> foreach my $line (readline FILE) {
>       $line =~ s/^.*\s//g;
>         open FILE2, "H:\My Music\artists.txt";
>         print FILE2 $line . "\n";
>         close FILE2;
> }
> 
> close FILE;

I'd go with:

open FILE, 'H:\My Music\folderlist.txt';
open DEST, '> H:\My Music\artists.txt';
foreach my $line(readline FILE) {
        chomp;
        print DEST $1."\n" if $line =~ /<DIR>\s*(.*)$/;
}
close FILE;
close DEST;

It might work, but haven't tested it. :) Tell if it did.

David.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to