Im trying to use the
$variable_name =~ s/[string_to_remove]/[string_to_add]
command to replace text found in an array.
Code below is direct excerpt from my code.
the text is in XML format and has been passed into an array for the program to modify. I know that the word im looking to replace. Which in this case is "empty" is in the file but when I later view the @displayArray the reference to empty has not been replaced.
Any suggestions as to why this is not working much appreciated.
$variable_name =~ s/[string_to_remove]/[string_to_add]
command to replace text found in an array.
Code below is direct excerpt from my code.
Code:
$emptyReplace = "($FORM{'elementName'})";
$empty = "EMPTY";
foreach $i (@xmlFileArray)
{
if ($i =~ /$empty/)
{
@displayArray[$displayCount] =~ $i/$empty/emptyReplace/i;
$displayCount ++;
}
}
Any suggestions as to why this is not working much appreciated.