use MP3::Info; opendir(DIR, ".") or die "can't opendir $some_dir: $!"; @files = grep { /mp3/ } readdir(DIR); closedir DIR; for (@files) { my $tag = get_mp3tag($_) or print "Could not access tag on $_\n" and next; my $newname = $tag->{"ARTIST"} . " - " . $tag->{"TITLE"} . ".mp3"; `move "$_" "$newname"`; }