Lee Clemmer <[EMAIL PROTECTED]> wrote: > s/$search/$newstr/i
You might want to modify this to s/$search/$newstr/igo The "o" promises Perl you will never change the $search string. Perl will then put it through the regular expression compiler the first time it's encountered, and you _should_ perform a little better. The "g" covers the case where the search string occurs more than once per line. Another tweak would be to set $/ = undef; This puts Perl into "slurp" mode, and a single read reads all the data in the file. This has advantages and disadvantages. The advantage is that you have all the data internally, and don't have to write your output file unless something actually changed. The disadvantage is that you have all your data internally, and may have memory problems with big files. Tom Wyant Tom Wyant This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as "E-Contract Intended", this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs