#!/usr/bin/perl -w use strict; my @files = `find . -name "*.flac"`; foreach my $file (@files) { chomp($file); #print "$file\n"; my $title = ($file =~ m|/([^/]+)$|) ? $1 : $file; $title =~ s/\.flac$//; # Remove .flac $title =~ s/^(\d+\.)/$1 /; # Add a space $title =~ s/_/ /g; # Replace underscores with spaces #print "\t\t\"$title\"\n"; my $cmd = "metaflac --set-tag=TITLE=\"$title\" $file"; print "$cmd\n"; system($cmd); }