How can I change the following code so that the #do stuff block will run against any new lines that the search n replace will create. My current workaround to this is to read the file in, search and replace (to create new lines),
close the filehandle, reopen it, and now the the new lines that were created before are on all separate lines?
while(<fp>)
{
s/\(/\n\(\n/g;
s/\)/\n\)\n/g;
#do stuff to current line
}