Hi,
For replacing the contents of an array :
This code snippet replaces the string "MODIFIED" by "MOD"
foreach(@arr) {
s/MODIFIED/MOD/g;
}
foreach(@arr) {
print "$_\n";
}
This is a round about way of assigning values of one array to another.
#!/usr/bin/perl -w
@arr1 = ("This","is","something","coo
Dear sir,
I have two array variables. I want to find $a[1] and replace $b[1] in a
file.
($a[1],$b[1] are array variables)
How to find and replace the variable contents.
for ($i=0;$i<$totalnum;$i++){
s/$a[i]/$b[i]/g;
}
Is it possible to do search and replace or kindly suggest me an idea
Thanki
On Tue, 2004-07-20 at 15:42, Baskaran wrote:
> Dear sir,
>
>
> I have two array variables. I want to find $a[1] and replace $b[1] in a
> file.
> ($a[1],$b[1] are array variables)
> How to find and replace the variable contents.
>
> for ($i=0;$i<$totalnum;$i++){
> s/$a[i]/$b[i]/g;
> }
>
You ha