What did you expect it to do?
It opens the file and iteratively reads in a line and then replaces "L"
with "titi". Did you anticipate that it would update the file contents?
That requires you to open an output file and print to that file handle.
-----Original Message-----
From: COLLINEAU Franck [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 7:26 AM
To: [EMAIL PROTECTED]
Subject: substitution
Hi!
Here is my code:
#!/usr/bin/perl
open (FIC, "toto.txt") || die "Impossible d'ouvrir toto.txt $! \n";;
while(<FIC>)
{
$_=~s/L/titi/;
}
close FIC;
It does nothing, why ?
Thanks
Franck
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]