File::Copy does the opening/closing of files for you. You might be messing
things up by doing an open/close around the copy operation (though I can't
see why myself). Try just:
--------------------------------------
#!/usr/bin/perl -w
use strict;
use File::Copy;
copy("temp.htm", "lmi/aol.htm");
--------------------------------------
I tried this code quickly on my (linux) system and it seemed to work. It
should also work on win32 if that's what you're using (seeing as you're
trying to copy .htm files).
If it doesn't work, hopefully the addition of "use strict" will give you a
clue. If not, since you've already opened the files you could just
"while(<TEMP>){print FICHIER}" (won't necessarily work for binary files.)
-- Brad
> Hi!
>
> I want to copy "temp.htm" to "aol.htm"
> Why doesn't this code work ?
>
> #!/usr/bin/perl -w
> open(TEMP, "+>temp.htm");
> open(FICHIER,">lmi/aol.htm");
> use File::Copy;
> copy("temp.htm","lmi/aol.htm") ;
> close FICHIER;
> close TEMP;
>
>
> 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]