In my case I want to replace the forward slash with a hyphen. These are the methods I know of. The sed and perl methods become hard to read with the back slashes. Is there a more readable sed and perl method to do this? Is there an awk method to do this? Are there any other methods to do this?
The / characters only need to be escaped because they are the designated separators for the s command. My go-to in this situation is to use % as the separator, because it is much rarer (unlike the / in dates and pathnames), and still has a diagonal line as a reminder of its purpose.
I am adding a reply to my own answer, because for some reason the "edit" option is not available to me on my post of April 9th. The words "designated separators" require a fuller explanation.
I checked the man sed page, and it merely specifies that the substitute command (and the similar transliterate command) are s/regexp/replacement/ and y/source/dest/. This is simply not true. The info sed description has a fuller explanation which specifies that any character can be used to delineate the regexp and replacement text, and that chosen character then needs to be escaped if used in those texts.
The '/' characters may be uniformly replaced by any other single character within any given 's' command. The '/' character (or whatever other character is used in its stead) can appear in the REGEXP or REPLACEMENT only if it is preceded by a '\' character.
So in sed 's%/%-%g', the "designated separator" is % because it immediately follows the s. And it does mean immediately: a space or tab is accepted as a separator here.