in reply to more then one string replacement
What you are trying to do with this line:
s/@find/$replace/g;is not, strictly speaking, possible in the way you meant it. Others here have suggested iterating through your @find array, searching for each element. In this case, you'd be better off simply using a case-insensitive search (as recommended by others), and not enumerating all of the expected case variations on the word, 'description'.
However, since regexes are interpolated as double-quoted strings, you may say something like:
{ # $" is the separator Perl uses to join array elements within a # double-quoted string, in effect, as the value of join($", @find) local $" = '|'; s/@find/$replace/g; tr/=/:/; }
Although, in this case, you really would be better off with: s/description/Summary/gi; followed by tr/=/:/;.
dmm
You can give a man a fish and feed him for a day ...
|
|---|