in reply to string substitution

Something like this (untested):

$newstring =~ s/([+<-/)*>])HELL([+<-/)*>])/$1BAD$2/g;
You need the $1 and $2 to retain your symbols. update symbols between square brackets according to your wishes

Cheers
Sam

Replies are listed 'Best First'.
Re (2) string substitution
by mandog (Curate) on Oct 08, 2003 at 17:07 UTC
    Greetings seaver

    you might escape some of the chars in your char class.

    For example, inside a char class '-' is a range operator. [a-e] instead of [abcde]

    Also it is hard to tell the paren inside your char class from the first closing paren