M
Martina
How to replace (change) some pattern in array with value of variable.
Replace substring "_.modem_" with modem price from $price
----------------------
@fileList=("Price for new modem is: _modem_?.", "Modem is price is:
_modem_?.");
$price=10;
foreach $red(@fileList){@rast = split ("_modem_",$red);
if ($#rast > 0) {
print "$rast[0]$price$rast[1]\n";
}
}
Replace substring "_.modem_" with modem price from $price
----------------------
@fileList=("Price for new modem is: _modem_?.", "Modem is price is:
_modem_?.");
$price=10;
foreach $red(@fileList){@rast = split ("_modem_",$red);
if ($#rast > 0) {
print "$rast[0]$price$rast[1]\n";
}
}