I am trying to insert the "$new_tag" value into the "$src" string, immediately after the "<record name="rightnav" type="content">" . The "$new_tag" is getting inserted but not at the desired position.
Please advice
$src ='<?xml version="1.0" encoding="UTF-8"?><record name="rightnav" t +ype="content"><item name="RHS_Image"><value>/me/accounts/include/imag +es/accounts_RHS.jpg</value> </item> <item name="RHS_Navigation">';
$new_tag ='<item name="abcd"><value>'; if($strFile =~ /<record (.*)>/igm){ $strFile =~ s/$&/$&$new_tag/i; }
Thanks in advance
In reply to Insert into string by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |