Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Insert into string
by Samy_rio (Vicar) on Jul 22, 2005 at 07:11 UTC | |
by Anonymous Monk on Jul 22, 2005 at 07:23 UTC | |
|
Re: Insert into string
by Cody Pendant (Prior) on Jul 22, 2005 at 08:12 UTC | |
|
Re: Insert into string
by gopalr (Priest) on Jul 22, 2005 at 08:34 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |