Hi Franck
If copy is doing what I suspect, that could be your problem. I'm guessing
that the function is "copy ('old_file', 'new_file')", rather than, as you've
used it "copy('new_file', 'old_file')". If that is the case (check the
File::Copy documentation) then what your program would seem to do is open
your original file, make all the substitutions and save it (so far so good).
Then it copies the original file over top of the new file, and then deletes
this new copy. Oops.
Try swapping round the file names in the copy command, or comment out both
that and the unlink line.
Cheers
Mark
> -----Original Message-----
> From: COLLINEAU Franck FTRD/DMI/TAM
> [mailto:[EMAIL PROTECTED]]
> Sent: 31 July 2001 16:18
> To: Perl (E-mail)
> Subject: module File::Copy
>
>
> Hello!
>
> I have a problem with this code:
>
> #!/usr/bin/perl -w
> use File::Copy;
> open (CONCAT,"lmi/concat.htm") || die "impossible d'ouvrir concat.htm:
> $!\n";
> open (CONCAT2,">lmi/concat2.htm") || die "impossible d'ouvrir
> concat2.htm:
> $!\n";
> while(<CONCAT>)
> {
> s/<CENTER>//i;
> print (CONCAT2 $_);
> }
> close (CONCAT);
> close (CONCAT2);
> copy("lmi/concat.htm","lmi/concat2.htm");
> unlink("lmi/concat2.htm");
>
>
> there are two problems: the instruction s/<CENTER>//i doesn't work and
> copying files doesn't work too.
>
> can anybody help me ?
>
> 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]