Hi Monks,
i need your help.

I want to write a program which will search some text and replace it with another text in all files in the folder (and subfolders). The number of files is big (several thousands) and this is a CGI-script so the working time is limited.

So my first idea was File::Find but i need some stuff to make me possible to continue searching on next script start.

So

  1. i get list of all filenames in the search folder (and it's subfolders) and wrote it to a file (FILELIST.txt).
  2. in the main loop i get one line from FILELIST.txt and search and replace in it
  3. if everything goes fine i'm delete one line (first) from FILELIST.txt and save in to disk.
  4. going to point 2

My questions is: