in reply to Creating filenames
You probably want to use a variable whose value is the number of elements in @words for the max (rather than the hard-coded '12'). As you've written it now, your for loop cycles 12 times (regardless of how many words were found in the title) and when $words[i] is empty, you get the trailing hyphens.