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

You're getting the occasional underscore because you include one in the replacement chars. Try changing tr/.../_/d to tr/...//d

Dave.

Replies are listed 'Best First'.
Re^2: All special character substitution and/or drop from column names.
by paulu (Initiate) on Feb 24, 2005 at 14:24 UTC
    The _ was to replace the spaces. However in a "Name & Something Else" I ended up with "Name__Something_Else".
      Ah sorry, I didn't notice the double underscore. In that case, as other people have pointed out, the /s option is the way to go:
      $ perl -le'$_="Name & Something Else"; tr/ &/_/sd; print' Name_Something_Else

      Dave.