in reply to All special character substitution and/or drop from column names.

You could also try to specify the characters you want, and replace everything else (this makes sure you don't miss any special characters you haven't thought of (yet)). untested:
$tvid =~ s/[^a-zA-Z0-9_-]/_/g;

Update: Fletchs solution using tr///cs would be more efficient.
  • Comment on Re: All special character substitution and/or drop from column names.
  • Download Code