re: HELP...what am I doing wrong?

From: FlashMX (FlashMX_at_sympatico.ca)
Date: 11/30/04


To: "beginners@perl.org" <beginners@perl.org>
Date: Tue, 30 Nov 2004 11:28:41 -0500

--Original Message Text---
From: FlashMX
Date: Tue, 30 Nov 2004 07:42:55 -0500

Hi Charles,

You input has helped greatly...thanks

Things have kinda changed in the last few days in the way I need to do my script. Previsouly I was reading in an external file. Checking for a certain match and then
replacing some text while at the same time writing the results out to a temoporary file. This all works great but I have to do another approach.

How would I do the following:

Read an external file which has a list of other external files listed within. Like this.

external file contents
-------------------------

S: 1 F: file1.txt
S: 2 F: file2.txt
S: 3 F: file3.txt
S: 4 F: file4.txt
S: 5 F: file5.txt

Then I need to open each file from the list one at a time and check for a certain string match. If found, do a search and replace and write the results out to a temoporary file
(file1.tmp). Then rename that file back to the original (file1.txt). Then continue to the next line until the end has been reached.

I can't figure out the logic for this. Can you help?

Thanks



Relevant Pages