in reply to s/$foo// selective interpolation?
Good catch! Better still: s/[$LEFT_DELIMITER]\Q$chord\E[$RIGHT_DELIMITER]//g
Update: After testing, I'd actually rewrite this as:
$LEFT_DELIMITER = '{['; $RIGHT_DELIMITER = '}]'; $tempstr = 'This is a string containing [Am]brackets.'; $chord = 'Am'; $tempstr =~ s/[\Q$LEFT_DELIMITER\E]\Q$chord\E[\Q$RIGHT_DELIMITER\E]//; print $tempstr; [download]