How about
/^(?i:ORACLE_SID|ORACLE_HST_SID|ORACLE_HOME|SDP_HOME)=/ && s/([^=]+)/(my $lhs=$1) =~ tr:_:.:; $lhs/e for @envArray;
Roger
update: better idea by Roy Johnson below. Doh!
However his code doesn't actually work because the brackets are the (?imsx-imsx:pattern) extension. Below is a possible fix:
s/^((?i)ORACLE_SID|ORACLE_HST_SID|ORACLE_HOME|SDP_HOME)(?==)/(my $lhs=$1) =~ tr:_:.:; $lhs/e for @envArray;
In reply to Re^2: substitution in a string
by Roger_B
in thread substitution in a string
by s_gaurav1091
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |