I'm trying to write a perl script that will - read a txt file with name=value pairs - loop through a shell script (see attached .txt file) - grab the contents of a particular function - replace the name=value pairs from the function with the value from the txt file - grab the corresponding case statement from the shell script - search and replace the values in the case statement - write it all out to a new file in the correct order. I need to be able to run this script on about 200 ksh scripts, mostly with the same name=value pairs. However, there are many scripts with different/extra name=value pairs. ex: It needs to take the abqenv () function, copy the whole thing to newenv (), replace all the value of all the variables with the new value that it gets from the txt file. Then put that new function *after* the abqapps function. next, it needs to grab each abqapps) sections (under the case statement) and do the same thing. Unfortunately, it's cutting off the "abqenv () {" and "}" lines from the abqenv part. argh! I have attached the perl script I have so far. Like I said, it mostly works. Please don't laugh too much at the ugliness of my perl. I'm no perl monk by any stretch. Any tips/help would be appreciated. Thanks David -- "I find your lack of faith disturbing." --Darth Vader