I am looking for some assistance in perl, please. I have most of the code built, but I am finding one part particularly challenging.

If FileA:

```
tag1=value1
tag2=value2

```

and FileB:

```
value1=<tag1>
value2=<tag2>

```

pseudo code:

```
open file 1
open file 2
 read line of data from file 1 while data exists
   change the equal sign to a space ( tag1=value1 becomes tag1 value1)
   separate the line into two variables

```

[**magic happens here** where I change the value in FileB to the actual value from FileA (see example below)]

```
close file 2
close file 1

```

So, I have tried several things, researched the heck out of this using Uncle Google (and here). I know there is a simple way of doing this using a single command line (

```
prompt> gawk '{sub(/=/," ")}1' [path]/[FileA] | 
    gawk '{system ("perl -pi -e \x27s/"$1"/"$2"/g\x27 [path]/[FileB]")}' 

```

), but I don't want to do it that way, but instead I am trying to make it happen inside my perl program because I like making things harder on myself it seems :-p.

So, for example, if FileA contains

```
<tag1>=192.192.2.3
<tag2>=5400

```

and FileB contains

```
connect IP=<tag1>
connect port=<tag2>

```

at the end of this program, I want FileB to contain

```
connect IP=192.192.2.3
connect port=5400

```

I understand how to perform substitutions in the program, BUT, I am having difficulty getting it to update the file.

Any hints would be welcomed; I don't even need a full solution, just something to point me in the right direction.

This is *not* homework.