LoneRanger has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use MP3::Info; use File::Find; use File::Basename; find(\&wanted, "/MP3"); sub wanted { /\.mp3$/ && do { my $tag = &MP3::Info::get_mp3tag($File::Find::name,1,1); $artist = $tag->{ARTIST} or die "$File::Find::name has no TAG info +"; $prev_artist = "me"; my($dir) = $File::Find::dir; $artist =~ s/ /\\ /g; if ($artist ne $prev_artist) { $FName = "\"" . $File::Find::name . "\""; print "I shall be making these directories\: $dir/$artist\n"; qx { mkdir $dir/$artist ; mv $FName $dir/$artist }; $prev_artist = $artist; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MP3 Mover script
by athomason (Curate) on Aug 24, 2000 at 14:51 UTC | |
by LoneRanger (Acolyte) on Aug 24, 2000 at 16:08 UTC | |
by LoneRanger (Acolyte) on Aug 24, 2000 at 15:04 UTC | |
by davorg (Chancellor) on Aug 24, 2000 at 15:08 UTC | |
by LoneRanger (Acolyte) on Aug 24, 2000 at 15:23 UTC |