Hey Thanks for the replies. My whole idea is that I have a folder called C:\myFolder which has some files. Now i want to scan each files' contents in this folder for a particular expression, say myExp.Process that expression and pick a word from it which is a file name. Then with this new file name (ex: a and append .txt to it), I have to search it in a list of directories that will be present in an array with me in perl. Check their presence and if they are present check for the above expression myExp2. Thus in a way there can be recursive search. For this if I scan line-by-line in a perl program then it will just slightly better than a C program. Hence i wanted to search the whole file initially with a command which will take an expression and search the whole file ,something like grep. Please help me on the same. Thanks in advance, Nishith