psimonovsk has asked for the wisdom of the Perl Monks concerning the following question:
I supposed result to be:$old_db="emdb1"; $new_db="kuku"; $string="AUTHORIZATION,libctl62-m.sl,CONTROLM,emdb1,b02ed6600206ca161d +165355c67b72073b6123d6838f1f68203b78cb9c4c63c9,emdb2,,;" ; $str_regexp = "\$1\$2\$3${new_db}," ; $string=~s/([^,]*,)([^,]*,)([^,]*,)([^,]*,)/$str_regexp/e; print "${string}\n";
Edit: g0n - code tags round long output lines
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: use qr// variable in right side of s/// operator
by mk. (Friar) on Feb 15, 2006 at 12:10 UTC | |
by psimonovsk (Novice) on Feb 15, 2006 at 14:02 UTC | |
by mk. (Friar) on Feb 15, 2006 at 14:54 UTC | |
Re: use qr// variable in right side of s/// operator
by brian_d_foy (Abbot) on Feb 15, 2006 at 14:42 UTC | |
by ikegami (Patriarch) on Feb 15, 2006 at 16:52 UTC | |
by brian_d_foy (Abbot) on Feb 15, 2006 at 20:17 UTC | |
by ikegami (Patriarch) on Feb 15, 2006 at 20:24 UTC | |
Re: use qr// variable in right side of s/// operator
by Tanktalus (Canon) on Feb 16, 2006 at 01:06 UTC |