Try this. Remember to save the data after you've changed it...
---
$input = "c:\\test\\test.txt";
$output = "c:\\test\\out.txt";
open IN, $input or die "Can't open $input: $!";
open OUT, ">$output" or die "Can't open $output: $!";
while (<IN>) {
s/html/php/ig;
print OUT;
}
close OUT;
close IN;
---
John
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 09 July 2001 12:05
To: [EMAIL PROTECTED]
Subject: remplace ...
Hi,
I want to remplace all the word "html" in "php" in some web pages ...
I tried this but nothing is happening :
open (TRANS, "c:\\test\\test.txt");
@transformation=<TRANS>;
foreach $ligne (@transformation)
{
chomp($ligne);
$transform=$ligne;
$transform=~s/html/php/g;
};
close (TRANS);
--------------------------Confidentiality--------------------------.
This E-mail is confidential. It should not be read, copied, disclosed or
used by any person other than the intended recipient. Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful. If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.