Check out the File::Find module.  It should come standard with your
distribution.



-----Original Message-----
From: Nishi Bhonsle [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 31, 2006 2:39 PM
To: beginners@perl.org
Subject: Perl script to search and replace a string in a file

Hi:

I have the following script that takes in an input file, output file and
replaces the string in the input file with some other string and writes
out
the output file.
I want to change the script to traverse through a directory of files
ie instead of prompting for input and output files, the script should
take
as argument a directory path such as C:\temp\allFilesTobeReplaced\ and
search for a string x and replace it with y for all files under that
directory path and write out the same files
perl C:\temp\allFilesTobeReplaced\

How do I do this?

Please help.
Thanks in advance.
--------------------------------------

<snip>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to